rewriting the javascript code, in a more OOP way