Cleaning up the test code a bit