Cleaned up the instanceof use in MainTabController