check to ensure that row counts in most tables are unchanged from the start and end of the tests. Refactor some code.