template code sanitization