Refactor repository.