refactor repository and upload