make tabs into a widget, make it DRY and add behavior