refactoring navbar