use BarcodeHandler to refactor code