Refactoring of events, merge templates