more js tidy up