Unbungled the templates a bit