using immutable collections in state machine