Template application cleanup.

- The last patch kind of failed to apply all the potential usage cases.