improved tokenization