Simplifying index.js a bit