We're starting to iterate through the incoming data a few times. Do you think this could be replaced with a generator?