token implementation