Added support for multiple templates