Refactor change detection

WIP
as usual no space after `!` ;)