Adds an event section and a bit of refactoring