Some js tidy up for speed.