refactor topBar button instantiation method.