add helper functions to StructuredOutputMachine