Refactor to create HttpClient, HttpClientRequest and HttpClientResponse.