Refactor set_event_handler_uncompiled for clarity