downloader refactoring