object-oriented refactor