templateReplacement function added (III part)