Refactor around templates.