refactoring of the RepoService and unit tests