each and templating