Move the sample/beacon logic inside Node