Some code optimization, in preparation for factoring out this common pattern for items parser modules.