
643 A.2d 367 (1994)
Carol Jellison DRAKE, et al.
v.
TOWN OF SANFORD.
Supreme Judicial Court of Maine.
Submitted on Briefs April 26, 1994.
Decided June 6, 1994.
*368 Erland B. Hardy, Thomas Danylik, Woodman & Edmands, Biddeford, for plaintiffs.
Catherine R. Connors, Pierce, Atwood Scribner, Allen, Smith & Lancaster, Portland, for amici curiae.
Anne H. Jordan, Patricia McDonough Dunn, Jensen, Baird, Gardner & Henry, Portland, for defendant.
Before WATHEN, C.J., and ROBERTS, GLASSMAN, CLIFFORD, RUDMAN and DANA, JJ.
WATHEN, Chief Justice.
Plaintiffs Carol Jellison Drake and William F. Jellison appeal from a judgment of the Superior Court (York County, Fritzsche, J.) denying their claims that they were denied equal protection and that their property was taken without just compensation in violation of the United States Constitution. Because plaintiffs voluntarily dismissed with prejudice their state law claim for compensation, they *369 cannot now argue that they have been deprived of just compensation in violation of the federal constitution. We vacate and remand for dismissal of the federal just compensation claim. Finding no error with regard to the equal protection claim, we affirm the judgment in that respect.
Plaintiffs own unimproved property in Sanford located on a peninsula containing almost exclusively non-conforming uses. The Town denied plaintiffs' request for a building permit because the Shoreland Zoning Ordinance (SZO) requirement of a 75 foot setback from water bodies could not be met. Plaintiffs filed suit, alleging, among other things, a unlawful taking of their property in violation of the United States and Maine constitutions and a violation of their right to equal protection. Other claims were disposed of prior to trial. On the first day of trial, plaintiffs announced a stipulation that their claim of an unconstitutional taking pursuant to the Maine Constitution, the only claim requesting damages for the alleged taking under state law, was dismissed with prejudice.
Evidence at trial included the following uncontested testimony and stipulations: Most of the properties around plaintiffs' land had been improved prior to the adoption of the SZO. All properties that, like plaintiffs', had not been improved at the time the SZO was adopted were required to comply with the SZO. This rendered some properties, including plaintiffs', unbuildable. No non-conforming uses have expanded since enactment of the SZO, except in compliance with the SZO, but several non-conforming uses have been replaced or improved.
The jury found that the SZO does not substantially advance legitimate government interests and ruled in favor of plaintiffs on their federal takings claim. The Superior Court entered judgment for the Town, however, after concluding based on stipulated facts that no taking had occurred because plaintiffs could not comply with the independent provisions of the State Subsurface Wastewater Disposal Rules. The court also entered a judgment for the Town on the equal protection claim. Plaintiffs appeal and ask that the jury verdict be reinstated.
The Town argues initially that the courts lack jurisdiction over the federal takings claim because it is not ripe for adjudication. The Town is correct that there is nothing inherently wrong with the government taking property; only takings without just compensation violate the United States Constitution. Williamson County Regional Planning Comm'n v. Hamilton Bank, 473 U.S. 172, 194, 105 S.Ct. 3108, 3120-21, 87 L.Ed.2d 126 (1985). Therefore, "if a State provides an adequate procedure for seeking just compensation, the property owner cannot claim a violation of the Just Compensation Clause until it has used the procedure and been denied just compensation." Id. at 195, 105 S.Ct. at 3121 (emphasis added). Until a plaintiff has resorted to the state procedure and the amount of compensation has been determined, a claim under the federal just compensation clause is "premature" and "not yet ripe." See id. at 194-197, 105 S.Ct. at 3120-22. Courts cannot determine whether compensation is unjust until after the amount of compensation has been determined. Even if the state inverse condemnation procedure is not statutory but is a common law or state constitutional claim, that remedy must be pursued before the federal just compensation claim. Lerman v. City of Portland, 675 F.Supp. 11, 16 (D.Me.1987) (citing Culebras Enters. Corp. v. Rivera Rios, 813 F.2d 506, 515 (1st Cir.1987)). Maine does allow inverse condemnation claims. See Foss v. Maine Turnpike Auth., 309 A.2d 339, 344 (Me.1973); Lerman, 675 F.Supp. at 15-16. Plaintiffs dismissed their inverse condemnation claim with prejudice. The federal just compensation claim is not ripe, and in view of the dismissal, may never ripen. The just compensation claim must be dismissed.
Plaintiffs also argue that the court erred in granting a judgment for the Town on the equal protection claim. They argue that they were treated unequally when the Town allowed existing non-conforming uses, but not new construction, to install holding tanks, and that the SZO setback requirement bears no rational relation to its purposes. The Town replies that there was no irrational discrimination and that modernization of non-conforming uses is allowed.
When, as here, an equal protection claim does not involve a suspect classification, *370 the challenge to a difference in treatment requires a showing that the state's classification is arbitrary or irrational. Dishon v. Maine State Retirement System, 569 A.2d 1216, 1217 (Me.1990). "Universality is immaterial as long as those affected are reasonably different from those excluded and there is a rational basis for treating them in a different manner." Nadeau v. State, 395 A.2d 107, 113 (Me.1978) (citations omitted). The mere fact that persons similarly situated to plaintiffs were allowed to build before the SZO was enacted is immaterial. See Barnard v. Zoning Board of Appeals, 313 A.2d 741, 746-47 (Me.1974) (allowing such temporal distinctions to arrest unwanted trends).
The restriction on building is rationally related to one of the purposes of the SZO, to "prevent and control water pollution." Uncontroverted testimony indicated that keeping shoreland in an undeveloped state allows runoff water to collect in depressions and penetrate the ground, where organic materials absorb some contaminants. Obviously any structure in close proximity to the shoreline would interfere with this process. Additionally, allowing the improvement of non-conforming sewage systems bears a rational relation to the same purpose. The State is concerned about water quality and prohibits new subsurface wastewater disposal systems within 100 feet of the shoreline. It is nevertheless rational to allow an owner to replace a leaking system with one which is less likely to leak. Modernization of facilities connected with a non-conforming use is normally permissible. Gagne v. Lewiston Crushed Stone Co., 367 A.2d 613, 623 (Me.1976). Because the distinctions alleged by the plaintiffs bear a rational relation to the purposes of the SZO, the Superior Court correctly denied the equal protection claim.
The entry is:
Judgment on the federal just compensation claim vacated and remanded for entry of dismissal. Judgment affirmed in all other respects.
All concurring.
