Greatly improved templating.