refactoring tab navigation