refactor table