Added support for external templates system