Feature/state transition machine