refactoring away from emitting events