extracting template