Added writing of template to a string, than an output file