consolidate lines on scripts.js