The two branches of this if are so similar it would be better to unify them; the first line's last argument is then just <code> pbp ? pbp : bp </code> and everything else is the same.