New API for on_change

Modify the instance instead of returning a dictionary.

issue4203
review8581002