Refactor all the tab APIs