What is idinstate and how does it work ?