Refactor code and make navbar different for admin and nonadmin