statePattern