Thanks for your contribution.  One question: could this anonymous function be pulled into some meaningfully-named private fn?  This code is pretty tough to understand.