tidied up refs