Features/state machine

paired with @cdata  for state machine implementation