Refactored some aspects of ems domain. #403

9 jobs for experimental in 47 minutes and 14 seconds