object-oriented code refactoring