Inline stateManager functions to avoid multiple definition errors