refactoring, added an event