Tabs: Some code cleanup and optimization
Merge pull request #3744 from pjackson28/tabsfixes

Tabs: Some code cleanup and optimization