added possibility to use local files as templates