Refactoring to oriented-object