Refactoring mass-upload