Refactor uploads