remove RACK_ENV and RAILS_ENV and DRY it up