finished tidy up of token manager