refactor upload ctrl