tidied up php templates