refactoring creating event