BS-7060, factorize code