EZP-21046: deduplicated code