trying a template approach for callbacks