Replace module_sm with module_statemachine