Some template code clean-up.