refactoring processTab