Switching FSM state from a List to a Map.

It is a first draft, maybe something else could be improved.