Extracted download logic to DownloadTask.