Refactor testDownload