slightly change handling of tokens