Avoid updating state unnecessarily