refactored the prefix processing for a barcode