Refactoring on the onDownload method as well as some variable renaming in relation to the onDownload method