Dividend purification issues

Assalaamu 'alaikum dear Mufti and the rest of the team!
Could youplease enlighten me on two isses related to dividend purification.

  1. If the dividends come to my trading account, should I immediately cleanse them of their non-halal part or can I wait till the moment I withdraw the money from my trading account? If non-halal part of the dividends being kept on the trading account is further used to buy stocks, does it make them unlawful/haram? If so, what should be done with the stocks which have been bought partly with the money that should have been purified?
  2. There is shariah ruling which states that in case the stocks loose their shariah-complaint status and the price of the stocks is lower than the price which has been paid for them then the share-holder can wait to gain the ammount of initial capital. As far as I understood, the dividends which are obtained after the stocks lost their halal status can be taken by the share-holder to make up for the value lost of the stocks so that he/she can get the initial ammount of money paid for them. If that is the case, should such dividends recieved from the stocks that have become non-halal be also purified?
    Thanks very much for your responce(s) in advance, may Allah Almighty show mercy on us all!