refactoring of the repo part 2