I think you could clean this up a bit using get_field/3
.
While
get_change/3
only looks at the currentchanges
to retrieve a value, this function looks at the changes and then falls back on the data, finally returningdefault
if no value is available.