Revert "Ditch where clauses"

This reverts commit 44fc127e97d434a312b715f388806ca683f75c3b.