templates code cleansing