Made some cleanup.
Handle isStateSet everywhere.