extract download logic into downloader class and inject dependency