add a factory method to repo