Feature/add state machine