Refactored for Heroku