code refactoring in TabHandler.java