If you set up another company, NewCo, where you own 100% of the Share capital, and do a reorganisation, whereby you move Company B accross under the ownership of NewCo, thereby availing of share for share reorganisation exemptions from CGT for the shareholder under s. 586 and stamp duty for the company under s. 80. You can then hive up the trade from Company B to NewCo if you want and leave just a dormant company B.
There are various conditions that apply of course. You need to engage a tax specialist here, but the tax saving will more than justify the cost.
I'm not aware (off the top of my head) any way of transferring a company directly to yourself and gaining these exemptions but I stand to be corrected.