lambda capture descope to reduce memory spike footprint