Cleaned the test code a bit