updated preprocess dynamic templating