This trick is a little hard to read, maybe just go ahead and define a closure?