FSM based execution engine