refactoring the tab view