refactored EventHandler and removed repository and factory