Move event handling to eventdispatcher.d