strip templates of nonsense