Refactored Upload.py