Updated version of the business logic for the events. Small refactorings of the code.