Massive update to add user-defined templates.