Moved common js to script.js