added token type as parameter