Replace wfTemplate with TemplateFactory

Change-Id: I9e629f4661f1975418db2071a74b92d74bbb5cc5
Merge "Replace wfTemplate with TemplateFactory"