more process_event refactoring