split and simplify b generation