Remove the statemachine and use looser model with more flexibility