Moved global variables to index.js