state machine construction, reorganization