Refactored event triggers and handlers