refactored OOP