Capture results properly using closures.