refactor out cc-rails cookbook