template extraction library