Added ability to specify token type