finished OOP refactoring