refactor upload class