Refactoring repository injection