use template to avoid multi-def