add test for navbar change and some refactoring