refactored top_nav_render to DRY up code