refactor for new repository class