Added improved templating.