add a function-wrapping class