Move event handlers into event classes

Thanks to @Zaba and @nezza for feedback