refactored checking for rows in functional tests