starting to turn the repository logic inside-out