swapping difficult templating mechanism with pluggable callback