making cleaner code for heroku