refactored JS to OO