refactor token management (internals)