Better handling of custom templates and hooks.