x
extract event callback from event_loop to event_handler