Refactored s# upload and download