convert a couple of list comprehensions to generator expressions