Refactor Events Handling