Refactoring - make this code also usable for unlabeled tokens