Any reason for this `each`? Could you take the `if` below and pull it outside the `each`?