Refactoring inheritance