Refactoring OO implementation