general purpose templating based on go-on/replacer