extract the repository loading into it's own method