converted js to oop