Moves code to index.js