clean up the test run code a bit