Move logic from dispatch_request to helper method _dispatch_request