new recursive template