tidied up the tests code