Template HTML cleanup