reorganized into standalone heroku-compat format