Maybe this can be tightened up into a single comprehension?  I'm not sure which is better for readability though.