Added json Deserialize into State, added shared code for state