Refactored the HttpResponse creation