Separated out the download from the processing.
Re-ordered file to remove a global definition.