Code cleanup, stable node replacement code