improve bsb function