Merge duplicated code for the BottomBar classes