Cleanup of Index.js

A cherry pick of the 2 clean up commits provided in #128.