implement class with js