repository refactoring