working version before refactoring barcode_utils
partial refactor of barcode scanner