add example for template pattern