Heartbeat code & code window preparation