Refactoring in an OO style