To the extent not required for the immediate payment and retirement of the obligations being refunded or for the payment of expenses incurred in connection with such refunding and subject to any agreement with the holders of any outstanding bonds, principal proceeds from the sale of any refunding bonds shall be deposited in trust to provide for the payment and retirement of the bonds being refunded, payment of interest and any redemption premiums, and payment of any expenses incurred in connection with such refunding, but provision may be made for the pledging and disposition of any surplus, including, but not limited to, provision for the pledging of any such surplus to the payment of the principal of and interest on any issue or series of refunding bonds. Money in any such trust fund may be invested in direct obligations of or obligations the principal of and interest on which are guaranteed by the United States Government, in obligations of any agency or instrumentality of the United States Government, or in certificates of deposit issued by a bank, capital stock financial institution, qualifying mutual financial institution, or trust company if such certificates are secured by a pledge of any of such obligations having an aggregate market value, exclusive of accrued interest, equal at least to the principal amount of the certificates so secured. Nothing in this section shall be construed as a limitation on the duration of any deposit in trust for the retirement of obligations being refunded but which have not matured and which are not presently redeemable or, if presently redeemable, have not been called for redemption. Section 77-2366 shall apply to deposits in capital stock financial institutions. Section 77-2365.01 shall apply to deposits in qualifying mutual financial institutions.