Refine restore state logic.