better states handling