Simplified index.js code a little bit.