externalize javascript