refactored downloader