Extracted call to updateState to a private method