Avoiding unnecessary state changes.