Fully implemented StateManager.