refactoring wrt tokens