Repository refactoring