event refactoring