refactoring of some of the test harness