Factorized settings and added heroku settings