first version of template system