Clean up http_client code