set up template code