Refactoring events pub/sub