improved templating and word wrap