seperated app.js and auth code for readability and easy development