Extracted Token and State modules.