
165 S.E.2d 60 (1969)
3 N.C. App. 466
In the Matter of the CUSTODY OF Wilbur F. KING, III, an infant. Wilbur F. KING, Jr.
v.
Marilynn Lee KING.
No. 688SC443.
Court of Appeals of North Carolina.
January 15, 1969.
*61 William F. Simpson, Pink Hill, for petitioner appellee.
Aycock, LaRoque, Allen, Cheek & Hines, by C. B. Aycock, Kinston, for respondent appellant.
PARKER, Judge.
This case is controlled by the provisions of Chapter 1153, Session Laws of 1967, entitled "An Act To Rewrite The Statutes Relating To Custody And Support Of Minor Children," which is effective from and after 1 October 1967. G.S. § 50-13.1 et seq. "By enactment of this Chapter the Legislature has sought to eliminate the conflicting and inconsistent statutes, which have caused pitfalls for litigants, and to bring all of the statutes relating to child custody and support together into one act." In Re Holt, 1 N.C.App. 108, 160 S.E.2d 90.
G.S. 50-13.5(f) provides in part that "(i)f an action for annulment, for divorce, either absolute or from bed and board, or for alimony without divorce has been previously instituted in this State, until there has been a final judgment in such case, any action or proceeding for custody and support of the minor children of the marriage shall be joined with such action or be by motion in the cause in such action." (Emphasis added.) In this case an action for absolute divorce had been instituted by the husband against the wife in the Superior Court of Lenoir County. Service of summons in this divorce action had been made on the wife and no final judgment had been entered therein. Therefore, under the express language of G.S. § 5013.5(f) any action or proceeding for custody of the minor child of the parties should have been joined with the pending divorce action or be by motion in the cause in such action. The purpose of the quoted statutory provision is clear.
"In divorce actions, the marital rights and obligations of both husband and wife, as well as the custody and support of the children of the marriage, are before the court in a single action. In a habeas corpus proceeding the judge has jurisdiction of only one facet of the marital dispute, the custody and support of the children." In Re Custody of Sauls, 270 N.C. 180, 186, 154 S.E.2d 327.
Justice to all parties is best served when one judge is able to see the controversy whole. The statute so provides.
In the present case petitioner attempted to have the matter of custody determined in a separate habeas corpus proceeding. In view of the then pending divorce action, the custody proceeding should either have been joined with such action or have been by motion in the cause therein. Because of petitioner's failure to observe the statutory *62 procedure, respondent's motion to dismiss the petition should have been allowed.
The record before us discloses that when the order appealed from, dated 30 September 1968, was entered by the judge presiding at the session of Superior Court of Wayne County, no papers in connection with the habeas corpus proceeding had been then filed, but that the papers were subsequently filed in the office of the Clerk of Superior Court of Lenoir County on 14 October 1968.
This cause is accordingly remanded to the Superior Court of Lenoir County, which is directed to enter an order dismissing the habeas corpus proceeding.
Reversed.
BROCK and BRITT, JJ., concur.
