code refactoring in menu tables