Minor refactor in javascript.js, removing unused variables