use different way to extract templates