Refactored ems