nav code refactoring