Refactor HttpClient