adding template pattern