cleaning up index.js