Refactor interface of restoreWifiState.