improved and tidied up tests