clean up script.js file slightly