Refactor comprehensions