Minor optimizations in the usage of the HttpClient api