uploader refactor