html tidy up for templates