extract templates