template code cleansing