Extract out common code from the list parsers.