Class hierarchy refactoring.