Donald Bryson and Russell Nebeker, former Ogden police officers, for themselves and others similarly situated, including 835 former police officers and 89 former firemen, sought recovery of 100 percent of the contributions they had made to their retirement funds during such employment, whereas in accordance with their Retirement Acts,1 they had been refunded only 80 percent. They contend that their Acts are unjustly discriminatory and deprive them of equal protection of the law2 because other retirement acts for public employees, such as the Utah State Retirement Act,3 and the Judges’ Retirement Act,4 provide for refunds of 100 percent of contributions if the employee terminates before retirement.
There was no dispute in the facts and both parties made motions for summary judgment. The district court agreed with plaintiffs’ contentions and gave them judgment for refunds of a total of $191,219.11, representing the additional 20 percent of their contributions during employment, which had not been refunded, together with an award of attorneys fees. Defendant appeals.
Plaintiffs place some emphasis on the fact that defendant Utah State Retirement Office is the state agency which administers the retirement acts of these plaintiffs and also the Utah State Retirement Act, which covers other state employees, and the Judges’ Retirement Act. They argue that to refund a lesser amount to these plaintiffs than to other state employees who terminate is unjustly discriminatory and does not afford them equal protection of the laws. Looked at superficially, their argument is not without some plausibility. However, when the total picture is analyzed realistically it is seen that neither the defendant Retirement Office, nor the legislative enactments under which it administers the respective retirement systems, has arbitrarily divided public employees into the four different groups and made “fish and fowl” out of them by favoring some and disfavoring others.
It is essential that the several branches and departments of state government employ persons of widely varying abilities, experience, training and education to perform services widely differing in character. Due to those differences there are also wide *1282variances in the salaries paid, working conditions, hours, vacations, and sick leave. Differences in the respective retirement systems are but another aspect of those differences.
In considering the plaintiffs’ argument it is appropriate to have in mind certain facts about retirement systems generally. Their purpose is to establish a fund so that employees who serve a given number of years may then have an income during their retirement, with the resulting beneficial effects upon the employee and his family, the institution they serve, and upon the social and economic welfare of society. In its responsibility to promote the general welfare, it is within the power of the Legislature to create retirement systems that, in its judgment, will accomplish that purpose.
The obligation to return contributions to employees who terminate is an important cost factor in operating a retirement system. It is to be realized that the retention of a percentage helps to pay the costs of its maintenance and operation. This tends to keep the system solvent and better able to pay pensions to those who serve until retirement, all of which contribute to making it a better system. It seems quite obvious that if an employee can terminate at any time and withdraw 100 percent of the contributions he has made, there results two effects contrary to the purpose of the Act. The first is that being able to withdraw a greater accumulation of money provides a greater incentive to quit. This tends to lose employees and the benefit of their experience. The second adverse effect is that it relieves the employee who quits of any of the cost of operating the retirement system and leaves it to be borne entirely by the fund and those who continue in employment.
One of the legitimate objectives of a retirement system is to attract employees who have the right qualifications for their jobs and to provide incentives which will minimize turnover in personnel and thus retain the benefits of training and experience. It is to be realized that there are specialized aspects of attracting and holding policemen and firemen. It is common knowledge that most people prefer to avoid trouble and violence. But a peace officer is not privileged to avoid it. Even though his primary duty is to keep the peace, it is also his duty to seek out and deal with crime and violence; and when it occurs he must expect to be invited in and must be ready and willing to respond.
Without extenuating thereon it can be said in brief that firemen must also have particular traits of character and attitudes to be attracted to and remain in their vocation.
It is not to be doubted that the legislative acts referred to set up four different retirement systems which divide public employees into separate classes and treat each class differently. Each has its own separate legislative origin. They all have different contribution rates, methods of computing final average salary, retirement ages, cost of living adjustments and treatment of spouses, as well as the different percentage of refund upon termination of employment before retirement.
It is recognized that this setting up of the four separate retirement systems does divide public employees into separate classes and treats each class differently. But it is a well-established principle of law that people may thus be divided into classes, if the classification bears some reasonable relationship to the objective sought to be accomplished; and there is no invidious discrimination so long as all persons within the same class are treated the same way.5
It is our duty to assume that it was in awareness of what has been said above concerning the desirability of retirement systems and the purpose for which they were intended to serve that the legislature created each of the four retirement systems in the manner it thought would best accomplish its objective with respect to each group of employees. Consequently, it is our *1283opinion that because of the special character of police officers and firemen there is a reasonable justification, within the legislative prerogative, for providing for the return of only 80 percent of their contributions if they quit before retirement; and that inasmuch as all persons within those classes are treated the same, there is no unjust discrimination nor denial of equal protection of the laws, even though other state retirement systems provide for a return of a greater percentage of the employee’s contributions. Accordingly, the.judgment is reversed. No costs awarded.
ELLETT, C. J., and MAUGHAN, WILKINS and HALL, JJ., concur.. Utah Public Safety Retirement Act, U.C.A. 1953, Sec. 49-11-1, et seq.; Utah Firemen’s Retirement Act, U.C.A. 1953, 49-6a-l, et seq.
. Utah Constitution, Art. I, Sec. 2; U.S. Constitution, 14th Amendment.
. U.C.A. 1953, Sec. 49-10-1, et seq.
. U.C.A. 1953, Sec. 49-7a-l, et seq.
. Child v. City of Spanish Fork, Utah, 538 P.2d 184 (1975); Hansen v. Public Employees Retirement System Board of Administration, 122 Utah 44, 246 P.2d 591 (1952); State v. Mason, 94 Utah 501, 78 P.2d 920 (1938).