Refactor TabWidget