httpClient refactoring