Add Template and factory working example together