Revert "Use domonad and :when."

This reverts commit 9dd357662b769705b01443f8229dd5c299e41b0f.