Move object declarations ino script.js