For Each with templates