refactoring repository