refactoring to replace eventbus with typed listeners