Some changes in template pattern