
665 P.2d 154 (1983)
The PEOPLE of the State of Colorado, Plaintiff,
v.
Rodney Hugh WALKER, Defendant,
Sidney H. WALKER, Waltrout M. Walker and Kathy Walker, Petitioners-Appellants,
v.
William A. YORDING, Continental Surety and Fidelity Insurance Company, and their Attorneys-in-fact, Joseph Kuperus and William Gawson, Sureties-Appellees.
No. 82CA0197.
Colorado Court of Appeals, Div. I.
March 17, 1983.
Rehearing Denied April 7, 1983.
Certiorari Granted June 13, 1983.
*155 Steven T. Pelican, Colorado Springs, for petitioners-appellants.
Ron E. Ewing, Colorado Springs, for sureties-appellees.
STERNBERG, Judge.
The sole issue in this appeal is whether, pursuant to the terms of § 16-4-108(1)(c), C.R.S.1973 (1979 Repl.Vol. 8), a court has discretion to require a surety to return all or a portion of the premium paid for a bail bond where the bond is terminated by court order. We hold that the statute vests the trial court with such discretion and therefore reverse the order of the trial court and remand the cause to the trial court to exercise that discretion.
One Rodney Hugh Walker was charged with first-degree murder. Under Colo. Const. Art. II, Sec. 19, and § 16-4-101, C.R.S.1973 (1982 Cum.Supp.), a defendant charged with a capital offense may be held without bail only if "the proof is evident or the presumption great" that he is guilty. Here, on two occasions, the trial court refused to hear testimony on the "proof evident or presumption great" issue because the judge felt he was sufficiently informed of the facts of the case through information gained when issuing search and arrest warrants. Bail was set at $100,000 and Walker's parents and wife thereupon borrowed money to pay a $10,000 premium to the sureties, who issued three separate bonds totaling $100,000. Walker was released and remained free for 25 days.
When the court was conducting a hearing on pending motions, it had occasion to examine the grand jury transcript. Based on this additional knowledge of the case the court concluded that it had erred in releasing Walker on bond because proof of guilt was "evident or presumption great," and it therefore revoked the bond.
Walker's wife and parents moved the court for an order that the $10,000 premium paid the sureties be returned. The court denied the motion, ruling that it had no authority "to order return of any portion of the bond premium when, as in this case, the court revokes the bond for reasons other than a violation of the conditions of bond by the defendant." The court further stated that "while the defendant was free on this bond for only 25 days, the termination of the bond was by review of the court's order and not by any failure to perform the conditions or by any action of the bondsman." The trial court reasoned that the statute was designed to remedy the mischief occurring when a bondsman precipitously surrenders a defendant and thus was subjected to minimal risk during the brief period the *156 defendant was free. It held, therefore, that the situation here was not within the intent of the statute.

I.
The statute in question, § 16-4-108(1)(c), C.R.S.1973 (1978 Repl.Vol. 8), provides in pertinent part:
"If a compensated surety is exonerated by surrendering a defendant prior to the appearance date fixed in the bond, the court, after a hearing, may require the surety to refund part or all of the bond premium paid by the defendant if necessary to prevent unjust enrichment."
We conclude that the statute vests a trial court with discretion to order a refund of all or part of a bond premium if it concludes that failure to so order would result in unjust enrichment of the surety. While, as the trial court noted, termination of the bond by court order is not expressly provided for by its terms, the statute does not exclude a situation in which a defendant is surrendered at the court's initiation rather than the surety's. Thus, we do not consider the fact that the bond was terminated by court order as making the statute inapplicable to the situation here.
The statute creates a remedy to prevent unjust enrichment under circumstances in which the surety is exonerated by surrender of the defendant prior to the appearance date fixed in the bond. The surety's risk having been prematurely terminated, and the surety having been exonerated from liability on the bond, the court may require return of a portion of the premium taken to secure that risk. We perceive no basis to distinguish the situation here simply because the sureties were exonerated and their risk terminated by action of the court rather than by their act.
In this respect, we note that § 2-4-203(1)(a), C.R.S.1973, directs that in interpreting an ambiguity in a statute, we give attention to the object sought to be obtained, and that, by § 2-4-201(1)(c), C.R.S.1973, we must presume the General Assembly intended a just and reasonable result. See Stephens v. Denver, 659 P.2d 666 (Colo. 1983).
We also observe that in other instances the court has discretion to prevent injustice with regard to forfeitures. See § 16-4-109(3), C.R.S.1973 (1978 Repl.Vol. 8); Owens v. People, 194 Colo. 389, 572 P.2d 837 (1977); People v. Nichols, 34 Colo.App. 276, 527 P.2d 941 (1974).

II.
Contrary to the surety's contention, the language contained in the bond purporting to make the premium non-refundable does not prevent a court from ordering a refund. We recognize that parties may agree to waive applicable provisions of the law. However, such waiver may be unenforceable if public policy considerations so dictate. Restatement (Second) of Contracts § 178(1) (1979).
The statute, § 16-4-108(1)(c), C.R.S.1973 (1978 Repl.Vol. 8), expresses the intent of the General Assembly to give courts authority to refund all or a part of a bond premium to prevent unjust enrichment. This is a public policy determination. It finds support when consideration is given to the comparatively weak bargaining position one in need of a bond occupies vis-a-vis that of the surety providing the bond. See Schilb v. Kuebel, 404 U.S. 357, 92 S.Ct. 479, 30 L.Ed.2d 502 (1971).
Consequently, we hold that the provision in the statute allowing a trial court to exercise its discretion in ordering a refund of a bond premium, in whole or in part, to prevent unjust enrichment of the surety is part of any surety bond. We hold further that this statutory language protecting against unjust enrichment takes precedence over, and nullifies, a provision in a bond purporting to make a bond premium non-refundable.
The other contention of error is without merit.
The order is reversed and the cause is remanded to the trial court to determine the amount of premium, if any, the surety should return.
COYTE and BERMAN, JJ., concur.
