preparing and restoring