Templating improvements.

Signed-off-by: Euan T <euantorano@gmail.com>