Trying to reduce amount of work so heroku does not timeout.