replace function_wrapper with simpler, more standard invokable; misc cleanup