WIP: token refactoring