tidied up templates