Some cleaning up in index.js