repo refactoring