refactored to implement TabController