tidied up templates a little bit