prototype#1 of template parsing