removed the EventEmitter dependency by refactoring to use simple callbacks