factor out frozenDict method