extracted process_frame