refactoring: delegated eventhandler logic to EventHandler class static factory method now calls the constructor based on the type of arguments (eventhandler can be based on methodarguments or annotation arguments)