There are a couple of places that use essentially this same code to get a production state given an instances state. It'd probably be cleaner to extract into a simple function.