need to add template to all function