Tidied up test implementation a bit