Improved state machine. Tagging release_0_1_0