adjust templates to make vars safe