Consolidating logic for subnav