Bit of JS rework.