Added isValidBarCode and other helper methods