refactoring downloader