tidy up the code and remove Repo out of the argument