Refactor uploader