tidied up resources