Refactor HTTP client creation