Cleaned up download and upload code

Cleaned up logging