Extracted a method from StateCalculators calculateState.