move event handlers to event class