Refactoring repositories test