refactoring event system