CLC-4495 - Refactored tab selection logic