adding correct httpclient version and smaller refactorings.