Improves function getstates