The prodState function from the modeler plugin could be pulled out into utilities so you could use it here too.