Refactor HTTPClient