Adding proper template
Generalizing the template