refactored emulator initial cut