add template extends feature.