convert derived token classes to factory functions, since we don't need polymorphism