Made process_request less convoluted