downloader refactor