Refactored uploading\downloading