Simplify where implementation

As discussed at length in d265815015fc7b95d90b580e60f569de887fd2c6