Some work on the parser and template output