Generating template