refactor uploader