Refactored the creating of the HttpConent objects into separate methods.