This is the base code for download / data extraction