refractored literal to event emitter