Refactoring the topBar