streamline code for item-nav, dir-nav and subnav