two implementations for method tokenStream