(1) Prior to the termination of any liquidation, rehabilitation, or conservation proceeding, the court may take into consideration the contributions of the respective parties, including the association, the shareholders and policyowners of the insolvent insurer, and any other party with a bona fide interest, in making an equitable distribution of the ownership rights of such insolvent insurer. In such a determination, consideration shall be given to the welfare of the policyholders of the continuing or successor insurer.
(2) No distribution to stockholders, if any, of an impaired or insolvent insurer shall be made until and unless the total amount of valid claims of the association for funds expended in carrying out its powers and duties under s. 631.717 with respect to such insurer has been fully recovered by the association.