A lot of cleaning up in the templates