Refine restart functionality