added simple template support