I've got this code in my View that just list two type of links.Here's an example output:Nounal Pagescleaners/house-cleanersVerbal Pagescleaning/house-cleaningHere's the view code. How could this be refactored to remove duplicate and push logic and loops out of the view?  %h3 Nounal Pages  %ul.row-fluid  - categories.each do |category|    - subcategories.each do |subcategory|      %ul        %li= link_to #{category.pluralised_nounal_slug}/#{subcategory.pluralised_nounal_slug}, main_app.new_pluralised_nounal_subcategory_path(category: category.pluralised_nounal_slug, subcategory: subcategory.pluralised_nounal_slug), target: '_blank'  %h3 Verbal Pages  %ul  - categories.each do |category|    - subcategories.each do |subcategory|      - if category.verbal_slug.present? && subcategory.verbal_slug.present?        %ul          %li= link_to #{category.verbal_slug}/#{subcategory.verbal_slug}, main_app.new_verbal_subcategory_path(category: category.verbal_slug, subcategory: subcategory.verbal_slug, aspect: 'verbal'), target: '_blank'
View for displaying nounal and verbal pages
ruby;ruby on rails;haml