
632 P.2d 729 (1981)
96 N.M. 494
CITY OF ALBUQUERQUE, Plaintiff-Appellant,
v.
CAUWELS & DAVIS, MANAGEMENT CO., INC., A New Mexico corporation, Hertzmark-Parnegg Realty, Inc., a New Mexico corporation, Winrock Village, Ltd., a limited partnership, Hannes H. Parneg, Sidney S. Hertzberg, Chris Inman, Inc., a New Mexico corporation, Chris Inman, Inc., d/b/a Brooktree Homes, and Chris Inman, individually, Defendants-Appellees.
No. 13379.
Supreme Court of New Mexico.
August 13, 1981.
Malcolm W. deVesty, Asst. City Atty., Albuquerque, for plaintiff-appellant.
Rodey, Dickason, Sloan, Akin & Robb, William C. Schaab, Albuquerque, for defendants-appellees.

OPINION
FEDERICI, Justice.
Taxpayers (appellees) refused to pay gross receipts taxes levied by appellant, the City of Albuquerque (City) upon their income. The City brought suit in the district court to enforce the assessments. The district court entered summary judgment against the City, finding that the assessments violated a state statute and did not apply to these taxpayers in any event. The City appeals. We affirm.
Taxpayers are landlords of rented properties. The parties agree that the City is allowed to assess gross receipts taxes upon businesses in Albuquerque under authority of Section 3-38-3, N.M.S.A. 1978. That section reads as follows:

*730 A. A municipality may impose an occupation tax and classify any occupation, profession, trade, pursuit, corporation and other institution and establishment, utility and business of whatever name or character, like or unlike, and not licensed as authorized in Section 3-38-1, NMSA 1978, or not licensed by the municipality as authorized by any other law.
B. The occupation tax shall not exceed one dollar ($1.00) per annum for each one thousand dollars ($1,000) gross receipts of business done per annum except a minimum tax of five dollars ($5.00) per annum may be levied or an occupation tax in an amount not to exceed twenty-five dollars ($25.00) per annum per business may be levied on each business. A municipality may classify occupations and impose an occupation tax on each occupation. If a municipality chooses to classify for the purpose of levying an occupation tax, the classifications which shall be used are:
(1) manufacturing;
(2) utility;
(3) wholesale;
(4) retail;
(5) banking; and
(6) financial.
The City enacted Albuquerque Municipal Ordinance §§ 4-1-1 to 4-1-13 to levy gross receipts taxes on businesses. Since filing of this suit, the City has repealed the ordinance under attack here and has enacted a new ordinance. The ordinance involved in this suit imposed an "occupation tax on all gross receipts of every person doing business or engaging in business within the City." § 4-1-3. However, the ordinance then listed a series of partial and total "deductions" from the general tax. These deductions were for: (1) retail trade-ins; (2) the sale of motor vehicles; (3) sales outside the city; (4) sales by non-profit cooperatives; (5) intra-corporate transfers; (6) wholesale sales; (7) construction performed inside and outside the city; (8) construction performed inside and outside the city and sale, lease or rental of construction equipment outside the city; (9) certain sales subject to other taxes; and (10) sales by persons under the age of 18. § 4-1-5. The ordinance then listed a series of "exemptions." Exemptions were for: (1) banking; (2) utility franchises; (3) interdepartmental sales within business organizations; (4) unprocessed produce; (5) isolated sales and rentals; (6) nonprofit organizations; (7) certain dues and registration fees; and (8) remuneration for personal services § 4-1-6. Finally, the ordinance included a severability clause, which stated "that if any deduction or exemption granted by this ordinance be held invalid, it is the intent of the Council that the unaffected remainder of the ordinance be continued in force and that the taxpayers theretofore enjoying such deduction or exemption shall thenceforth, from the effective date of the declaration of invalidity, be liable for the rate of tax [that would normally be imposed without the deduction or exemption]." § 4-1-13.
The issues on appeal are:
1. Whether the City's occupation tax is valid; and
2. Whether any invalid portion of the tax is severable from the valid portions.
A number of the deductions and exemptions created by the ordinance were nothing more than a recital of federal and state laws which prevented the City from imposing the occupation tax on some businesses. Others simply recognized that certain transactions did not fall within the category of gross receipts of a business. In addition, the ordinance created classifications for the six types of business set out in Section 3-38-3. The problem here arises because the City imposed a general tax on all businesses, then proceeded to create exemptions and deductions for the six permitted categories plus some additional categories, such as construction, motor vehicles and children. The City admits that construction was an additional category.
The City argues that it enacted a uniform maximum occupation tax on all businesses under Section 3-38-3(A), and the deductions and exemption did not comprise a classification of occupations. Therefore, the classifications set forth in Section 3-38-3(B) *731 did not need to be followed. In the alternative, the City argues that through Section 3-38-3(A) the Legislature intended that all occupations be taxable. The classifications in Subsection (B) of the statute were not meant to be exclusive. Therefore, the City had authority to create additional classifications.
In construing the statute, we are mindful of the general rule that the purpose of construction is to give effect to legislative intent. See Chavez v. Commissioner of Revenue, 82 N.M. 97, 476 P.2d 67 (Ct. App. 1970). However, this Court noted in City of Clovis v. Crain, 68 N.M. 10, 13, 357 P.2d 667, 669 (1960) that:
The rule is well established that where the statute directs in definite terms the manner in which municipal acts are to be exercised, such statutory method must be substantially followed. Fancher v. Board of County Com., 28 N.M. 179, 210 P. 237; Bibo v. Town of Cubero Land Grant, 65 N.M. 103, 332 P.2d 1020; McQuillin, Municipal Corporations, 3d ed., Vol. 2, § 10.27, p. 640. Also, the direction of definite and certain method of procedure in the grant of power to the municipality excludes all other methods by implication of law. McQuillin, § 10.27, supra. Moreover, the statute making the grant of power to the municipality must be strictly construed, and the municipality must keep closely within its limits. 38 Am. Jur., § 385, p. 74.
The Court further stated that "a municipality is without power to change, by local law, the method of collecting taxes established by the legislature. "(Citations omitted.)" Id. 68 N.M. at 14, 357 P.2d at 669. One of the reasons for strict construction when taxing authority is delegated is that taxpayers should not be subjected to the burden of taxation without clear warrant of law. City of Miami v. Kayfetz, 158 Fla. 758, 30 So.2d 521 (1947). See Beatty v. City of Santa Fe, 57 N.M. 759, 263 P.2d 697 (1953).
Here, Section 3-38-3 allows municipalities to impose a uniform occupation tax on any occupation not otherwise licensed. In the alternative, the statute allows a municipality to impose a varied occupation tax upon classes of occupations. The classes which shall be used if this latter option is followed are specified in the statute. Our Legislature has directed that the word "shall" in statutes is mandatory, Section 12-2-2(I), N.M.S.A. 1978, and this Court has so held. Mountain States Tel. v. New Mexico State Corp., 90 N.M. 325, 563 P.2d 588 (1977).
The City followed neither of the alternatives required by the statute. Instead, it enacted both a uniform tax and a list of exemptions and deductions. The effect of the exemptions and deductions was to create a varied occupation tax upon classes of occupations. The City admits that at least one of the deductions created was for an occupation not listed in the statute. We hold that the City's occupation tax did not substantially comply with the authority delegated to it by Section 3-38-3. The City acted beyond the scope of its authority when it enacted the occupation tax ordinance, and the ordinance is unenforceable.
The City argues that the ordinance is severable, and only those portions which are unenforceable should be excised from it. While the effect of a declaration of severability in the ordinance creates a presumption that the ordinance is divisible, we cannot dissect invalid portions and reframe an ordinance from the valid portions where the remaining features will be substantially affected by the removal. Safeway Stores v. Vigil, 40 N.M. 190, 57 P.2d 287 (1936). Here, the valid portions are inextricably intertwined with the invalid portions of the ordinance and we cannot separate them without substantially affecting the ordinance. It is beyond the power of the courts to rewrite an ordinance. We hold that the entire ordinance is invalid.
This decision shall be given modified prospectivity and it shall not be retroactive. That is, it shall apply only to the case at bar and all similar pending actions. It affords no remedy for taxes previously paid by persons unless they have a pending judicial *732 action against the City concerning the ordinance.
The trial court is affirmed.
IT IS SO ORDERED.
SOSA, Senior Justice, and RIORDAN, J., concur.
