merge duplicate code in site_navigation.rb