Added overload of copyTemplate to allow extra substitutions