modded controllers/main/index.js to use the Omnifarious Pattern