refactoring table