Refactors switchTab, adds swap highlight