add template support