refactored upload / download methods