modification to clean up at least some of the token handling mess