refactored upload commad