Refactored heroku module