Added possibility to use templates from file