Avoiding unnecessary UI updates