minor rewrites in bridge detection functions