Migrated to the new CloseableHttpClient with tests