refactor upload and Download