Refactor HttpClient a bit.