externalized the JavaScript