refactor on httpclient use