refactoring, added event trait