Refactoring repositories