Feature/state transition machine

Ok