added caching of tokens