DRY'd up the named struct code.