Minor changes to tidy up index.js