added createUser test and tidied up a bit