refactor checking of list in the table