Refactored identification of parent class of state machine.