refactoring for repo 2.0