moar cleanup of event handling