parsing/updating state