moving process_task into its own function