adding object oriented style js