tidy up template a bit