Massive refactoring of eventHandlers.