
740 P.2d 1168 (1987)
106 N.M. 184
In the Matter of the Termination of Parental Rights with Regard to SAMANTHA D., a Child.
No. 96910.
Court of Appeals of New Mexico.
June 23, 1987.
Certiorari Denied August 14, 1987.
Joseph William Reichert, Albuquerque, for appellant and cross-appellee.
*1169 Wendy E. York, Gallagher & Casados, P.C., Anne H. Assink, Albuquerque, for appellees and cross-appellants.
Michael G. Sousa, Law Office of Joseph Rocca, Albuquerque, appellee and guardian ad litem.
OPINION
ALARID, Judge.
Appellant appeals from a judgment terminating her parental rights to Samantha D. She argues that: (1) the trial court erred in terminating her parental rights; (2) NMSA 1978, Section 32-1-54 (Repl. 1986) is unconstitutionally vague; and (3) she has been denied due process.
On cross-appeal, appellees claim that the trial court erred by: (1) not finding abandonment under Section 32-1-54(B)(1); (2) invalidating appellant's consent form for adoption; and (3) not following the doctrine of waiver and estoppel.
BACKGROUND
Appellant is the natural mother of Samantha D., born April 17, 1986. At the time of Samantha's birth, appellant was 18 years old and had never been married to the infant's natural father.
Prior to Samantha's birth, appellant, considering the possibility of adoption, discussed her thoughts with her mother, father, sister, friends and co-workers. Once she decided on adoption, appellant asked her father, himself an attorney, to contact an attorney for the purpose of placing her infant in the home of adoptive parents. Appellant wanted a good home for her child with parents who shared her own religious faith. Through the help of a local church, appellant's lawyer found suitable parents. Appellant relinquished her child within two days after birth, the identity of the adoptive parents remaining unknown to her.
On April 22, 1986, appellant executed a consent to adoption and affidavit which contained, inter alia, a statement that her attorney and her father had fully advised her of her rights and that it was in Samantha's best interests that she be adopted by appellees. On April 30, appellees filed their petition for adoption, which the trial court subsequently dismissed for lack of standing on the basis that appellant's consent for adoption was invalid.
Approximately one month after executing her consent, appellant wished to revoke it, feeling that she had made a mistake by giving up her child. Her father was willing to provide a home for her and the infant, and he agreed to be financially and emotionally supportive of both mother and child. Her attorney refused to inform appellees of appellant's change of heart, and she engaged other counsel. She filed a petition for writ of habeas corpus on June 24, 1986.
In August, the trial court entered an order denying the writ. Although the trial judge found that appellant's consent to adoption was invalid because it lacked the statutory requirements of the Adoption Act, NMSA 1978, Section 40-7-29 to -61 (Repl. 1986), he ruled that it was in Samantha's best interests to remain in the interim custody of appellees, with visitation privileges in appellant pending a termination proceeding. In addition, the trial court ordered a psychological evaluation of appellant and appointed a guardian ad litem to represent Samantha in the hearing set for appellee's petition for termination of parental rights. At least two psychological evaluations of appellant were conducted. One of the psychologists, Dr. Samuel Roll, observed appellant's interaction with the child in his office. His opinion that it would be in Samantha's best interests to remain with appellees was based, in part, on his personal observations. Dr. Herbert Levin, a psychiatrist, on the basis of his psychiatric evaluation of appellant, also opined that Samantha should remain with appellees.
On August 14, the trial court issued a letter of intent, stating and explaining its decision to terminate parental rights under Section 32-1-54(B)(4). On September 12, the court issued an amended order. On September 17, 1986, the New Mexico Supreme Court heard appellant's petition for writ of mandamus. Appellant sought to prohibit the trial court from leaving Samantha with appellees solely on the grounds *1170 that it was in the best interest of the child to do so. The supreme court denied the writ.
Subsequently, the trial court ruled on all requested findings and conclusions. The court found that although appellant would not have been an unfit mother to raise Samantha had she not initiated the adoption process, she had nonetheless caused the child to be in the care of appellees within 48 hours of birth. It was the trial court's judgment that appellant had abandoned her child pursuant to Section 32-1-54(B)(4); and, considering Samantha's best interests, she should remain with appellees. Moreover, the trial court found that abandonment under the statute could only be rebutted by appellant if she could show the trial court, by clear and convincing evidence, that it was not in the child's best interests to remain with appellees. The trial court found that appellant failed to carry her burden. Judgment for termination was entered on October 15, 1986. Notwithstanding the entry of judgment terminating parental rights, appellant was granted continued visitation privileges of four hours per week pending the outcome of this appeal.
DISCUSSION
The underlying facts of this case place this court in the unenviable position of making very basic decisions which will have a critical impact on the lives of several persons. While this court has great sympathy for all parties to this action, it is keenly aware of its obligation to evaluate and resolve the matter on the basis of the applicable law.
A. Issue of Abandonment and Termination of Parental Rights
The first and primary purpose of the Children's Code, NMSA 1978, Sections 32-1-2 to -55 (Repl. 1986), is "to provide for the care, protection and wholesome mental and physical development of children coming within [its] provisions," and secondly "to preserve the unity of the family whenever possible." § 32-1-2(A). This is not to imply, however, that parents have an absolute right to their children, for any right is secondary to the best interests and welfare of the children. Roberts v. Staples, 79 N.M. 298, 442 P.2d 788 (1968); see In re Adoption of Doe, 101 N.M. 34, 677 P.2d 1070 (Ct.App. 1984).
Each section of the Code must be interpreted with all other sections in order to ensure its legislative intent. State v. Doe, 95 N.M. 88, 619 P.2d 192 (Ct.App. 1980). Thus, in proceedings seeking to terminate parental rights on grounds of abandonment, the court must be satisfied, by clear and convincing evidence, that the best interests of the child will be served by severing the parent-child relationship. See § 32-1-54(A) ("the court shall give primary consideration to the physical, mental and emotional welfare and needs of the child"); State ex rel. Dept. of Human Servs. v. Natural Mother, 96 N.M. 677, 634 P.2d 699 (Ct.App. 1981) (findings to support termination of parental rights must be proved by clear and convincing evidence).
Appellant argues that the court erred in finding abandonment under Section 32-1-54(B)(4) which resulted in termination of her parental rights. She claims that the statutory factors creating a rebuttable presumption of abandonment under Sections 32-1-54(B) and (C) were not established by clear and convincing evidence. Appellant relies on In re Adoption of Doe, 89 N.M. 606, 555 P.2d 906 (Ct.App. 1976), to support her argument that the best interests of a child are not relevant to the issue of abandonment, since abandonment focuses on parental conduct. See also In re Term. of Par. Rights with Respect to I.N.M. and A.F.E., 105 N.M. 664, 735 P.2d 1170, 26 SBB 440, 443 (Ct.App. 1987) ("[a]bandonment focuses on parental conduct and not on the child's welfare"). We are not persuaded.
Prior to the 1985 legislative session, the statutory provision for termination of parental rights was found in the Adoption Act. See NMSA 1978, § 40-7-4 (Cum. Supp. 1984). In 1985, the Legislature repealed Section 40-7-4 and incorporated its provisions into a newly-enacted section of the Children's Code, Section 32-1-54. See 1985 N.M. Laws, ch. 194, §§ 39 and 40.
*1171 When In re Adoption of Doe was decided, abandonment was a legal basis for dispensing with parental consent in an adoption proceeding. Under this court's decision in that case, abandonment is a question of fact; there must be sufficient evidence to establish clearly and convincingly the fact of abandonment. In that case, this court identified two elements in the factual test for abandonment: (1) a conscious disregard for the obligations owed by a parent to a child; and (2) the destruction of the parent-child relationship. In re Adoption of Doe, 89 N.M. at 618, 555 P.2d at 918. That definition of abandonment continues to apply. See In re Adoption of Doe, 100 N.M. 764, 676 P.2d 1329 (1984); In re Term. of Par. Rights with Respect to C.P. and E.P., 103 N.M. 617, 711 P.2d 894 (Ct.App. 1985).
Termination of parental rights, however, need not always occur in the context of adoption. There are obvious occasions when the state must intervene on behalf of an abandoned, abused or neglected child who is not awaiting adoption but who, in the child's best interests, must be permanently removed from the custody of its parent. Possibly for that reason, or any other reason in the presumed wisdom of the Legislature, in 1985 it provided that a finding by the court that all of the conditions set forth in Section 32-1-54(B)(4) exist shall create a "rebuttable presumption of abandonment." § 32-1-54(C). See 1985 N.M. Laws, ch. 194, § 36.
We cannot agree with appellant that Section 32-1-54 is vague or ambiguous. Section 32-1-54(C) provides that in order for a rebuttable presumption of abandonment to be created, all of the conditions of Section 32-1-54(B)(4) must exist:
B. The court shall determine parental rights with respect to a minor child when:
* * * * * *
(4) the child has been placed in the care of others, * * * either by a court order or otherwise and the following conditions exist:
(a) the child has lived in the home of others for an extended period of time;
(b) the parent-child relationship has disintegrated;
(c) a psychological parent-child relationship has developed between the substitute family and the child;
(d) if the court deems the child of sufficient capacity to express a preference, the child prefers no longer to live with the natural parent; and
(e) the substitute family desires to adopt the child.
The trial court determined that all five conditions existed. Appellant argues that although she disagrees with the court's determination, she takes particular exception to the court's finding that an "extended period of time" in this case must be judged from the viewpoint of an infant rather than an adult. We do not disagree with the trial court.
Appellant physically gave up her child when the infant was less than 48 hours old, and executed an albeit defective consent to adoption form five days after the child's birth. It is clear that the result appellant now complains of was initiated by her own actions, and we cannot ignore the fact that, for the child, the absence of her natural mother constituted an extended period of time. This court has observed that a key element in determining whether parental rights should be terminated under Section 32-1-54(B)(4) is whether the parent-child relationship has disintegrated. See In re Adoption of Doe, 101 N.M. 34, 677 P.2d 1070 (Ct.App. 1984). We agree with the finding of the trial court that the child's extended absence from her natural mother led to the disintegration of the parent-child relationship.
The trial court heard testimony from several expert witnesses on the importance to an infant child of the bonding and attachment process that is created between infant and its mother figure between birth and 18 months. Although psychological testimony varied as to the effects on Samantha of removing her from appellees between the age of 6 and 18 months, the discrepancy was not so great for us to find error in the trial court's decision to leave *1172 the child in the custody of appellees. It is for the trier of fact, and not the appellate court, to weigh the evidence and determine the credibility of expert witnesses. Martinez v. Fluor Utah, Inc., 90 N.M. 782, 568 P.2d 618 (Ct.App. 1977).
We conclude, therefore, that the trial court did not err in terminating appellant's parental rights under Section 32-1-54(B)(4). We also conclude that appellant did not overcome the statutory presumption of abandonment. In view of the statutory presumption contained in Section 32-1-54(C), the trial court did not err in considering the best interests of the child after it had found that the conditions described by the statute existed. Cf. In re Adoption of Doe, 89 N.M. 606, 555 P.2d 906 (Ct.App. 1976).
Because we hold that clear and convincing evidence existed to support the trial court's judgment to terminate parental rights, appellant has not been denied due process. Cf. Barwin v. Reidy, 62 N.M. 183, 307 P.2d 175 (1957) (children should not be taken from their parents who have properly discharged their responsibilities, unless the parents are in agreement).
B. Consent Form
In keeping with the best interests of the child, the trial court retains the power to determine custody in the absence of a legally valid consent, and it was within the authority of the trial court to continue Samantha in the custody of appellees. Section 40-7-49(D); see In re Adoption of Doe, 87 N.M. 253, 531 P.2d 1226 (Ct.App. 1975). We affirm the trial court's ruling regarding custody following the invalidation of the consent and dismissal of appellee's petition for adoption.
Finally, we agree with the trial court that because appellant's consent was invalid, and she did not give up a known legal right, waiver does not apply. See Albuquerque Nat'l Bank v. Albuquerque Ranch Estates, Inc., 99 N.M. 95, 654 P.2d 548 (1982). Although appellees lacked standing to petition the court for adoption, they were not left without remedy, since they did have standing to seek relief under Section 32-1-54. See NMSA 1978, Section 32-1-55(A) (Repl. 1986).
CONCLUSION
The trial court is affirmed on all issues. The parties shall bear their own costs on appeal.
IT IS SO ORDERED.
MINZNER and APODACA, JJ., concur.
