Refactor Agent/EventHandler relationship