refactoring httpclient for asyn download