event emitter constructor factory