replacing tokens so each group can have a custom `base` and `root` value.