Set up state machine and created test factories