Further js optimisations