optomise javascripts