started refactoring of Repository, to reduce code duplication
started refactoring of Repository, to reduce code duplication