Template clean-up