added begin of template system