bar code factored out