Event handlers refactoring.