refactored for checking of table items