refactored the downloader