Use a state machine for stub data generator