added  row def and more strong typing for callbacks and templates.