Simplified has_changed function a bit more.