refactoring nav helper