Refactor change detection

WIP
I guess the assumption is that record is newly created and `record.nextEnabled` is `null`, because we not overwriting that pointer. Extend the comment if that's the case.