(b) How defenses and objections presented. Every defense, in law or fact, to a claim for relief in any pleading, whether a claim, counterclaim, cross-claim, or third-party claim, shall be asserted in the responsive pleading thereto if one is required, except that the following defenses may, at the option of the pleader, be made by motion in writing:
(1) Lack of jurisdiction over the subject matter;
(2) Lack of jurisdiction over the person;
(3) Improper venue;
(4) Insufficiency of process;
(5) Insufficiency of service of process;
(6) Failure to state a claim upon which relief can be granted;
(7) Failure to join a party under Code Section 9-11-19.
A motion making any of these defenses shall be made before or at the time of pleading if a further pleading is permitted. No defense or objection is waived by being joined with one or more other defenses or objections in a responsive pleading or motion. If a pleading sets forth a claim for relief to which the adverse party is not required to serve a responsive pleading, he may assert at the trial any defense in law or fact to that claim for relief. If, on a motion to dismiss for failure of the pleading to state a claim upon which relief can be granted, matters outside the pleading are presented to and not excluded by the court, the motion shall be treated as one for summary judgment and disposed of as provided in Code Section 9-11-56, and all parties shall be given reasonable opportunity to present all material made pertinent to such a motion by Code Section 9-11-56.
(c) Motion for judgment on the pleadings. After the pleadings are closed but within such time as not to delay the trial, any party may move for judgment on the pleadings. If, on a motion for judgment on the pleadings, matters outside the pleadings are presented to and not excluded by the court, the motion shall be treated as one for summary judgment and disposed of as provided in Code Section 9-11-56, and all parties shall be given reasonable opportunity to present all material made pertinent to such a motion by Code Section 9-11-56.
(d) Preliminary hearings. The defenses specifically enumerated in paragraphs (1) through (7) of subsection (b) of this Code section, whether made in a pleading or by motion, and the motion for judgment mentioned in subsection (c) of this Code section shall be heard and determined before trial on application of any party unless the court orders that the hearing and determination thereof be deferred until the trial.
(e) Motion for more definite statement. If a pleading to which a responsive pleading is permitted is so vague or ambiguous that a party cannot reasonably be required to frame a proper responsive pleading, he shall nevertheless answer or respond to the best of his ability, and he may move for a more definite statement. The motion shall point out the defects complained of and the details desired. If the motion is granted and the order of the court is not obeyed within 15 days after notice of the order, or within such other time as the court may fix, the court may strike the pleading to which the motion was directed or make such order as it deems just.
(f) Motion to strike. Upon motion made by a party within 30 days after the service of the pleading upon him, or upon the court’s own initiative at any time, the court may order stricken from any pleading any insufficient defense or any redundant, immaterial, impertinent, or scandalous matter.
(g) Consolidation of defenses in motion. A party who makes a motion under this Code section may join with it any other motions provided for in this Code section and then available to him. If a party makes a motion under this Code section but omits therefrom any defense or objection then available to him which this Code section permits to be raised by motion, he shall not thereafter make a motion based on the defense or objection so omitted, except a motion as provided in paragraph (2) of subsection (h) of this Code section on any of the grounds there stated.
(h) Waiver or preservation of certain defenses.
(1) A defense of lack of jurisdiction over the person, improper venue, insufficiency of process, or insufficiency of service of process is waived:
(A) If omitted from a motion in the circumstances described in subsection (g) of this Code section; or
(B) If it is neither made by motion under this Code section nor included in a responsive pleading, as originally filed.
(2) A defense of failure to state a claim upon which relief can be granted, a defense of failure to join a party indispensable under Code Section 9-11-19, and an objection of failure to state a legal defense to a claim may be made in any pleading permitted or ordered under subsection (a) of Code Section 9-11-7, or by motion for judgment on the pleadings, or at the trial on the merits.
(3) Whenever it appears, by suggestion of the parties or otherwise, that the court lacks jurisdiction of the subject matter, the court shall dismiss the action.
(i) Officer’s defense of service. The officer making service of process and the principal officer in charge of service made by a deputy need not be made a party to any action or motion where the defense or defenses under paragraph (2), (4), or (5) of subsection (b) of this Code section are asserted by motion or by answer. Any party to the action may give notice of the objection to the service, made pursuant to such paragraphs, to the officer making the service and to the principal officer in case of service made by a deputy, and the court shall afford the officer or officers opportunity to defend the service, in which case the decision on the question of service shall be conclusive on the officer and on his principal in case of service by a deputy.