Used inheritance instead of templates.