Tidied up HttpClient implementation