refactoring of the GCS heartbeat logic.