Refactor: needed to register events