diff --git a/main.cc b/main.cc
index 251b10a..64c6aba 100644
--- a/main.cc
+++ b/main.cc
@@ -46,45 +46,6 @@
 
 namespace {
 
-const int kTimeoutOnce = 7 * 60;  // at 7 minutes
-const int kTimeoutPeriodic = 45 * 60;  // every 45 minutes
-const int kTimeoutFuzz = 10 * 60;  // +/- 5 minutes
-
-// Schedules an update check |seconds| from now, while adding some fuzz.
-void ScheduleUpdateCheck(int seconds,
-                         GSourceFunc update_function,
-                         UpdateAttempter* update_attempter) {
-  seconds = utils::FuzzInt(seconds, kTimeoutFuzz);
-  g_timeout_add_seconds(seconds, update_function, update_attempter);
-}
-
-gboolean UpdateOnce(void* arg) {
-  UpdateAttempter* update_attempter = reinterpret_cast<UpdateAttempter*>(arg);
-  update_attempter->Update("", "");
-  return FALSE;  // Don't run again.
-}
-
-gboolean UpdatePeriodically(void* arg) {
-  UpdateAttempter* update_attempter = reinterpret_cast<UpdateAttempter*>(arg);
-  update_attempter->Update("", "");
-  ScheduleUpdateCheck(kTimeoutPeriodic, &UpdatePeriodically, update_attempter);
-  return FALSE;  // Don't run again.
-}
-
-void SchedulePeriodicUpdateChecks(UpdateAttempter* update_attempter) {
-  if (!utils::IsOfficialBuild()) {
-    LOG(WARNING) << "Non-official build: periodic update checks disabled.";
-    return;
-  }
-  if (utils::IsRemovableDevice(utils::RootDevice(utils::BootDevice()))) {
-    LOG(WARNING) << "Removable device boot: periodic update checks disabled.";
-    return;
-  }
-  // Kick off periodic updating.
-  ScheduleUpdateCheck(kTimeoutOnce, &UpdateOnce, update_attempter);
-  ScheduleUpdateCheck(kTimeoutPeriodic, &UpdatePeriodically, update_attempter);
-}
-
 void SetupDbusService(UpdateEngineService* service) {
   DBusGConnection *bus;
   DBusGProxy *proxy;
@@ -167,7 +128,7 @@
   update_attempter.set_dbus_service(service);
   chromeos_update_engine::SetupDbusService(service);
 
-  chromeos_update_engine::SchedulePeriodicUpdateChecks(&update_attempter);
+  update_attempter.InitiatePeriodicUpdateChecks();
 
   // Update boot flags after 45 seconds
   g_timeout_add_seconds(45, &chromeos_update_engine::UpdateBootFlags, NULL);
diff --git a/update_attempter.cc b/update_attempter.cc
index 7873166..b0c470b 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -35,6 +35,21 @@
 
 namespace chromeos_update_engine {
 
+namespace {
+
+const int kTimeoutOnce = 7 * 60;  // at 7 minutes
+const int kTimeoutPeriodic = 45 * 60;  // every 45 minutes
+const int kTimeoutFuzz = 10 * 60;  // +/- 5 minutes
+
+gboolean CheckForUpdatePeriodically(void* arg) {
+  UpdateAttempter* update_attempter = reinterpret_cast<UpdateAttempter*>(arg);
+  update_attempter->Update("", "");
+  update_attempter->SchedulePeriodicUpdateCheck(kTimeoutPeriodic);
+  return FALSE;  // Don't run again.
+}
+
+}  // namespace {}
+
 const char* kUpdateCompletedMarker = "/tmp/update_engine_autoupdate_completed";
 
 const char* UpdateStatusToString(UpdateStatus status) {
@@ -411,6 +426,27 @@
   return true;
 }
 
+void UpdateAttempter::InitiatePeriodicUpdateChecks() {
+  if (!utils::IsOfficialBuild()) {
+    LOG(WARNING) << "Non-official build: periodic update checks disabled.";
+    return;
+  }
+  if (utils::IsRemovableDevice(utils::RootDevice(utils::BootDevice()))) {
+    LOG(WARNING) << "Removable device boot: periodic update checks disabled.";
+    return;
+  }
+  // Kick off periodic update checks. The first check is scheduled
+  // |kTimeoutOnce| seconds from now. Subsequent checks are scheduled
+  // at |kTimeoutPeriodic|-second intervals.
+  SchedulePeriodicUpdateCheck(kTimeoutOnce);
+}
+
+void UpdateAttempter::SchedulePeriodicUpdateCheck(int seconds) {
+  seconds = utils::FuzzInt(seconds, kTimeoutFuzz);
+  g_timeout_add_seconds(seconds, CheckForUpdatePeriodically, this);
+  LOG(INFO) << "Next update check in " << seconds << " seconds.";
+}
+
 void UpdateAttempter::SetPriority(utils::ProcessPriority priority) {
   if (priority_ == priority) {
     return;
diff --git a/update_attempter.h b/update_attempter.h
index b2ef371..1c9ad40 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -88,6 +88,13 @@
   // UPDATED_NEED_REBOOT. Returns true on sucess, false otherwise.
   bool RebootIfNeeded();
 
+  // Kicks off the periodic update checks, if necessary.
+  void InitiatePeriodicUpdateChecks();
+
+  // Schedules the next periodic update check |seconds| from now. Note
+  // that the actual timeout will be fuzzed.
+  void SchedulePeriodicUpdateCheck(int seconds);
+
   // DownloadActionDelegate methods
   void SetDownloadStatus(bool active);
   void BytesReceived(uint64_t bytes_received, uint64_t total);
