added reference_wrapper handling and started to move to invoke()