Better code for request handling