Some memory optimizations for token extension.