refactor table.check