Refactored for heroku
Refactored for heroku