Refactor switch to tabs.