Refactoring and redefining contracts for repos