implement contents of invoke_*