navbar code refactoring