Cleanup belongs to tests

simplified logic to calculate number of queries by using assert_queries