complete token handling in Document