Refactoring by using Repository semantics