Cleaning up init_global_frame function