Cleanning template code