
445 N.W.2d 303 (1989)
Gordon C. THOMPSON, County Judge of Williams County, in trust for the several use and benefit of the occupants of the Townsite of Buford, North Dakota, Plaintiff,
v.
BUFORD TOWNSHIP, a municipal corporation of Williams County, North Dakota, Defendant and Appellant, and
Williams County, North Dakota, a municipal corporation, Defendant and Appellee, and
all other persons unknown, claiming any estate or interest in or lien or encumbrance upon the mineral estate in the property, Defendants.
Civ. No. 890063.
Supreme Court of North Dakota.
August 15, 1989.
Janet Holter Zander, of Anseth & Zander, Williston, for defendant and appellant.
Charles Wilder, Asst. State's Atty., Williston, for defendant and appellee.
VANDE WALLE, Justice.
This is an appeal brought by Buford Township from a judgment dividing property held in trust by the county judge of Williams County. We reverse and remand.
In 1906, a patent was issued to Astoria A. Austill, in his capacity as county judge for Williams County, in trust for the use and benefit of the occupants of the townsite of Buford, located in Williams County. The patent was granted pursuant to Sections 2387, 2388, and 2389 of the Revised Statutes of the United States, later codified as 43 U.S.C. § 711, et seq. Gordon C. Thompson, judge of the county court of Williams County, by virtue of his office, is the successor trustee of Judge Austill.
Thompson, by filing a complaint in county court, sought to distribute the remaining property interest held in trust and the proceeds from oil and gas leases issued covering the property in question.[1] Buford *304 Township responded to the complaint asserting that it was entitled to the property and proceeds of the trust. It contended that the spirit of the trust would be fulfilled by turning the property and proceeds of the trust over to the most local governing body, Buford Township, which would use the funds for maintaining roads in the township. A hearing was held at which Williams County also appeared.
In awarding all the mineral rights and bonuses and one-half of the royalty interest to Williams County and awarding the remaining one-half royalty interest to Buford Township, Judge Thompson, sitting as the judge of the county court of Williams County, concluded:
"This appears to be a case of first impression and there being no on point case law on how to divest a trust for a `to be' incorporated town that was never incorporated, equity is to play a major role in deciding how to apportion the proceeds of the fund.
. . . . .
"The court must agree that as a matter of equity the minerals and income therefrom should be divided between the Township and the County. Roads certainly are an important element of the cost of governing. And here the Court is mindful that we must not reach to the absurd. For, just as we cannot feasibly trace down the heirs of those residents of the community since just after the turn of the century, neither is there any sense in conjuring up what the Federal or State governments have done for this area. The taxpayers of Buford Township in the County have benefited from county services such as title registration in the Register of Deeds, levying and collection of taxes, law enforcement and yes even the Courts. And one only has to take notice of the meetings of our County Commission to see the straits which the County as well as the township have fallen upon. The Court finds that past services as well as future benefits make it equitable that the royalty windfall in this case should be shared equally by the Township and the County.
"Because of the greater overhead of county government and the attendant payroll of stewards able to lease the minerals the Court will give past and future rights to lease the minerals to the County. The bonus will therefore go to Williams County. Past and future royalties will go equally to the Township and the County."
The Township appealed, arguing that the evidence presented at trial does not support the trial court's conclusion; rather, the evidence "indicates that the spirit of the trust would best be fulfilled by conveying the entire trust property and proceeds to Buford Township." The Township also argued that the trial-court judge should have been disqualified because he was the trustee of the property and was the one who initiated this action.
Because we conclude that the trial court misapplied the controlling statutes and based its decision in part on irrelevant matters, we reverse and remand for further consideration.
Prior to its repeal in 1976, 43 U.S.C. § 718 provided:
"Whenever any portion of the public lands have been or may be settled upon and occupied as a townsite, it is lawful,... [if the townsite is not incorporated] for the judge of the county court for the county in which such town is situated, to enter at the proper land office, and at the minimum price, the land so settled and occupied in trust for the several use and benefit of the occupants thereof, according to their respective interests; the execution of which trust, as to the disposal of the lots in such town, and the proceeds of the sales thereof, to be conducted under such regulations as may be prescribed by the legislative authority of the State or Territory in which the same may be situated."
*305 The above-quoted Federal statute left the defining of terms and execution of the trusts to the State legislatures. Martin v. Hoff, 7 Ariz. 247, 64 P. 445 (1901). But "[w]hile the act of congress leaves the details of the use of the proceeds of the surplus fund to be regulated by the legislature, it is very clear that the law designed that they should be used for the common benefit in some way." In re Selby, 6 Mich. 193, 209 (1859). See also Jones v. City of Petaluma, 38 Cal. 397, 406 (1869) ["Congress, in the passage of these laws, had in view the individual interests of bona fide settlers upon small parcels of public lands as well as the common interests of a community of persons, ..."]. [Emphasis in original.] Thus, although Congress laid some guidelines for State legislatures to follow, it left the State legislatures broad discretion in deciding what was to be done with the proceeds.
In accordance with the above-quoted Federal statute, the Territory of Dakota enacted Chapter 135 in 1881. That chapter was one of the sources of Article 21 of Chapter 32, Cities and Villages, of the 1905 Revised Code of North Dakota. Section 3027 thereof provided that the judge or his successor was to dispose of the trust in the manner specified in that article. Section 3042 provided that the proceeds derived from the sale of unclaimed lands were to be placed in the general fund of such city, town, or village. Section 3043 provided:
"In case there should be found any surplus on hand over and above receipts for fees and awards for expenses arising from the conveyances of lots ... then such surplus shall as soon as ascertained by the corporate authorities of such city, town or village, or county judge, be accounted for and turned over to the treasurer of such city, town or village to be by such treasurer placed to the credit of the general fund of such city, town or village, then to be disbursed and applied as follows: To aid school districts within their incorporate limits, to construct, repair, and furnish school houses, to erect and repair public buildings within their corporate limits, to construct and repair roads, to lay down and repair sidewalks, and crossings, to construct sewerage and irrigation canals within their corporate limits, to purchase other lots or parcels of land either within or without their corporate limits, or any other general purpose that will conduce to the interest of the community; provided, however, that no part of this fund shall ever be appropriated for salaries of any city, town or village officer."
Article 21, Chapter 31, of the 1905 Revised Code is, in essence, a trust instrument.[2] In construing a trust instrument the primary objective is to ascertain the intent of the trustor. In re Larson, 341 N.W.2d 627 (N.D.1983). A reading of Article 21 reveals that the Legislature intended that funds obtained as a result of the Federal Act quoted above were to be administered by the local community[3] ["such surplus... turned over to the treasurer of such city, town or village to be ... placed to the credit of the general fund of such city, town or village ..."] and to be disbursed and applied to benefit the local community. Because the townsite was not incorporated there is no "city, town or village" to which the proceeds can be disbursed. However, in an application of equitable principles, independent of the cypres doctrine, the court has the power to modify the terms of a trust in order to substantially carry out the intention or to effectuate the primary purpose of the creator of the trust. 89 C.J.S. Trusts, Sec. 87 (1955); 76 Am.Jur.2d Trusts, Sec. 277 (1975). It appears that the most "local" unit of government next to that of a city, which unit of government is capable of effectuating the enumerated purposes for which the proceeds are to be used in that *306 local area, should be given the most serious consideration in this matter.
Thus, while the trial court was correct in considering the units of local government which, in the absence of an incorporated city at the townsite, could best assist that area in accordance with the intended use of the proceeds, we are not convinced from the record before us that sufficient consideration was given to the statutes as we have construed them. We have grave doubts that the benefits the Township or the local area have received from the County are entitled to much, if any, consideration in the distribution of the proceeds nor, for that matter, is the financial condition of the County or any perceived "windfall" to the local area particularly meaningful to that determination. Because some of these extraneous matters were not only considered by the trial court but appear to have been major factors in its decision in distributing the proceeds, rather than the factors we have outlined as significant, we reverse the judgment and remand for a new trial.
On remand, the trial court is to give due consideration to the intent of the Legislature as provided in Article 21 of Chapter 31 of the 1905 Code. Although we have emphasized that the intent of the trust is that the proceeds should go to the local community via the most appropriate local unit of government, we do not necessarily conclude that Buford Township is entitled to all the proceeds. The Township should be given due consideration but the trial court must decide which local unit of government can best effectuate the purposes of the trust for the local area of which the townsite is a part.[4]
Buford Township also argued on appeal that the trial judge should have disqualified himself because he was the plaintiff who initiated this action and he is the trustee of the trust in question.[5] The Township raised this matter in an oblique manner to the trial court and did not file a demand for change of judge or request the judge to recuse himself. We are disturbed that the issue was not squarely raised at the trial-court level but rather raised on appeal after the judge had ruled on the matter before him. Delay in squarely raising the issue gives the impression that if the judge were to rule in favor of the appellant there is no problem and that the problem exists only if the judge rules against the appellant. Judge Thompson had no personal interest in the outcome of this proceeding; he became trustee by operation of law when he assumed the judgeship in Williams County. Nevertheless, Rule 3(C)(1) of the North Dakota Rules of Judicial Conduct specifies:
"(1) A judge's disqualification is appropriate when the judge's impartiality might reasonably be questioned, including but not limited to instances where:
. . . . .
"(d) a judge ...
"(i) is a party to the proceeding, or an officer, director, or trustee of a party; ..."
Although Judge Thompson may not have had any interest in the outcome of this proceeding, a judge must avoid even the *307 appearance of impropriety. See Rule 2, N.D.R.J.C. Because we are remanding for reconsideration on the merits and because the issue of a conflict of interest has been placed before us, we deem it advisable that on remand this case be assigned to Judge William McLees, county judge of McKenzie County, or such other judge of the Northwest Judicial District as the Presiding Judge of that district may designate pursuant to AR 2.
ERICKSTAD, C.J., and MESCHKE, LEVINE and GIERKE, JJ., concur.
NOTES
[1]  At the time of this lawsuit there remained the mineral estate and proceeds from oil-and-gas-lease bonus payments in the amount of $4,328. There also are monthly royalty checks being received and deposited in a savings account. As of the date of the trial court's memorandum opinion there was approximately $14,471 in that account.
[2]  This article apparently was repealed by omission from the Compiled Laws of 1913. See Section 1-02-19, N.D.C.C.
[3]  The school district would have been considered to be a part of the "local community" and, particularly because it is specifically referred to in the statute, might have been entitled to at least a portion of the proceeds, but no one appeared on its behalf in this action although it apparently received notice.
[4]  At oral argument it was suggested by Williams County that the Buford townsite is not a viable community. Evidence at trial indicated that only two people live in the townsite and there is only one place of business. On the other hand, Buford Township points out that there remains a commonly recognized community located within Buford Township known as "Buford" and, it asserts, that even if no one lived in the townsite, that circumstance would not be determinative because the benefit runs with the townsite. That argument has some merit in light of the Township's position that proceeds received would be used to maintain roads in the township; even if no one lived in the townsite, or township for that matter, people would arguably still need to travel across the townsite to reach destinations on the other side of the townsite.
[5]  The county court has concurrent subject-matter jurisdiction over trusts. Secs. 30.1-02-02 and 30.1-33-01, N.D.C.C. Under the circumstances of this case wherein the county judge was denominated as the plaintiff, the better practice would have been to file the pleadings in district court rather than county court.
