Rewrite index.js