By Dano Manion: add template fun.