Refactoring for more OO way