refactored the logic out of the nav bar