upload class refactoring