Tidy up base JS