Add a function to list the templates and add a code to detect valid
templates