some refactoring in table