js class structure