Remove usages of when.chain