generalize bridge script