Refactor in-place dirty checking to use the attribute object