refactoring EventHandler