Added templateFactory