Refactor out methods that deal with repository details