added code to handle formats list and format/type detail templates.