added a OOP refactor