case doesn't seem like it's doing anything here.  Can't this be `foreach { token => ...`