Optimize download and uncompress functions to global variables.
Adjust scripts to new functions