Refactoring about barcode