Associating the sub-state machine with a particular state