statemachine: better handling when there are several statemachines in the same source file