simplify index.js