improve the way of gracefully stopping the state machine
move the state machine test in a separate file
disable some of the verbose logging