Refactored and simplified downloader.