More refactoring in TabWidget