Avoid multiple state changes