tidy up of js