uploader refactoring