fix conversion to OOP