minor refactor app/helpers/content_generator.rb to simplify code there