Replace `cond` with pcase