writing token extraction