using EventEmitter refactor