Use of the new function update-state\!
Refactoring