
182 Cal.App.4th 1050 (2010)
A.H., Petitioner,
v.
THE SUPERIOR COURT OF ORANGE COUNTY, Respondent.
ORANGE COUNTY SOCIAL SERVICES AGENCY et al., Real Parties in Interest.
No. G043003.
Court of Appeals of California, Fourth District, Division Three.
March 11, 2010.
*1054 Law Offices of J. Michael Hughes and Lawrence A. Aufill for Petitioner.
No appearance for Respondent.
Nicholas S. Chrisos, County Counsel, Karen L. Christensen and Julie J. Agin, Deputy County Counsel, for Real Parties in Interest.
Law Office of Harold LaFlamme and Karen Cianfrani for Minors.

OPINION
O'LEARY, J.
A.H. (Father) seeks relief from the juvenile court order at the 12-month review hearing terminating his family reunification services and setting a permanency hearing pursuant to Welfare and Institutions Code section 366.26.[1] Father has four children: Robert (seven years old), Laura (six years old), Makayla (four years old), and Alfred (three years old).[2] Father was incarcerated for much of the dependency period, which hindered his ability to participate in his case plan. On appeal, he argues the juvenile court should have applied section 361.5, former subdivision (a)(2),[3] which takes into account a parent's incarceration, rather than section 366.21 subdivision (g)(1), which does not. We conclude the juvenile court correctly considered both statutory provisions, and there was ample evidence to support its orders. We deny the writ petition.

I
On October 21, 2008, the children were taken into protective custody after their parents were arrested on outstanding warrants. They had been living in *1055 deplorable conditions. Their home was a filthy basement containing an open sewer hole full of urine and feces. There was no refrigerator, and the children did not have enough food. They were not fed on a consistent basis. Mother, Father, and other residents in the home smoked methamphetamine when the children were present.
Father gave the police a false name and claimed to be just visiting. He had a criminal record and was affiliated with gangs. Mother appeared to be under the influence of drugs. There were three prior child abuse reports regarding the children, including a substantiated report Laura required hospitalization due to rotten teeth.
The petition (filed under § 300, subds. (b) & (g)) alleged the children were living in an unsanitary and unhealthy home, Father had an unresolved substance abuse problem, the oldest child had not been enrolled in school, and the parents engaged in domestic violence in front of the children. Finally, the petition alleged the parents were unavailable due to their incarceration.
At the detention hearing, the juvenile court determined there was a substantial danger to the children's health if they were not removed from their parents' custody. Father attended the hearing. The court ordered services and twice-weekly monitored visitation.
After 10 days, Father was out of custody and met with the social worker. Father said he had enrolled in a substance abuse program. Father was given referrals for case plan services, which included random drug testing, drug patch testing, bus passes, and Alcoholics/Narcotics Anonymous meetings (AA/NA meetings). He visited the children at Orangewood Children's Home, and it was reported the visits went well.
In early November, the children were placed in a foster home. They displayed no behavioral problems, but it appeared Robert was depressed. Robert commented he liked that his new home did not smell like "pee." Robert discussed his failure to attend school and the domestic violence he and his siblings witnessed. Laura said she saw her parents steal and argue frequently. She said it made her younger siblings cry. All the children suffered from severe tooth decay.
On November 12, Mother reported to the agency she and Father were homeless. Father missed several appointments to have a drug patch applied. He missed two random drug tests. One test had been positive for benzodiazepines. Father ignored the parenting education facilitator's attempts to invite him to meetings. He did not attend any meetings or appear at the pretrial hearing on November 26. On that day, he was arrested for shoplifting.
*1056 In mid-December, Father and Mother pled no contest to an amended petition. Both parents were again incarcerated. The court ordered family reunification services for the parents. Father was given one visit per week while he remained incarcerated.
Before the six-month review hearing, the social worker reported Father was released from custody on January 5, 2009. He failed to respond to the social worker's attempts to contact him. On January 20, the paternal grandmother reported she had kicked him out of her home because she knew he was using drugs. Father did not participate in any 12-step meetings, enroll in classes, or drug test while he was out of custody. On January 22 Father was arrested for larceny, violating probation, and a gang enhancement. Although Father was eligible for services in jail, none were available. In addition, Father did not have access to mental health services. The social worker gave Father a parenting education workbook that he read, and he completed all the worksheets. Father's criminal trial was set for June 2009, and therefore, his release date was unknown.
The social worker reported Father's one-hour visits with the children were appropriate. The children enjoyed the visits but sometimes they were ready to leave before the hour was over. Father stated he wanted to cooperate and comply with reunification. The social worker concluded, "[a]lthough [Father] has been cooperative while incarcerated, he was not when he was out prior to his arrest in January 2009. [Father] has not attempted to explain his behavior prior to his second arrest nor did he apologize for it." The social worker recommended additional services, explaining the extended time would allow her to evaluate Father's motivation, how long he would remain in jail, and the likelihood of reunification. The social worker also noted the children were happy in their placement and bonded with their caretakers. The caretakers wanted to adopt the children. At the hearing on June 8, the court continued with reunification services and scheduled a 12-month review hearing for November 9, 2009.
In the report prepared for the 12-month review hearing, the social worker recommended terminating reunification services and scheduling a permanency hearing. Father had been transferred from the Theo Lacy Facility to Wasco State Prison. He was due to be released from custody on March 13, 2010.
Father had received no services in jail before his transfer. The social worker had tried unsuccessfully to make contact with him. Father had written to the children, but it took him a month to respond to the social worker's letter asking him about transporting the children to the prison for visits. The children wanted to visit him despite the longer drive. At the prison, the only *1057 services available were AA/NA meetings organized by the inmates. Father told the social worker that once he was released he would do whatever it took to get his children back. She noted he had been very cooperative while incarcerated, but she opined his behavior in January 2009 spoke "volumes with regard to his priorities." The social worker did not believe there was a substantial probability of return with an additional six months of reunification services because it was unlikely Father would be able to obtain lawful employment, acquire safe, adequate housing, or provide for four small children. Before his arrest, Father lived a transient drug lifestyle, associated with gang members and was involved in illegal acts despite knowing his children were dependents of the juvenile court, and his parental rights could be terminated. The social worker was unsure if Father's recent cooperative efforts were due to his incarceration or from a true desire to regain custody.
At the hearing, the social worker and Father testified. The court determined there was a substantial risk of detriment to return the children to Father's custody. It concluded there was not a substantial probability the children would be returned to his care within the extended period of time. The court terminated reunification services and set a permanency hearing.

II
On appeal, Father maintains the court "wrestled with the fact" there were three code sections that seemed applicable to the 12-month review hearing. He contends the juvenile court relied too heavily on section 366.21, subdivision (g), which Father argues sets an impossibly high standard for an incarcerated parent to satisfy. He states section 366.21 subdivision (f), and/or section 361.5, former subdivision (a)(2), compel courts to consider mitigating factors unique to incarcerated parents. He concludes the evidence shows there were institutional barriers that prevented him from complying with his court-ordered services, and he made a good faith effort to regularly visit with his children. However, we note Father does not go so far as to argue there was evidence suggesting the children would have been returned to his care before the 18-month deadline if he had been given an additional six months of services. We conclude the juvenile court correctly weighed and considered all relevant factors under all three code provisions when making its ruling.
(1) "The dependency scheme sets up three distinct periods and three corresponding distinct escalating standards for the provision of reunification services to parents of children [or a sibling group containing a child] under the age of three. During the first period, which runs from roughly the jurisdictional hearing (§ 355) to the six-month review hearing (§ 366.21, subd. (e)), services are afforded essentially as a matter of right (§ 361.5, subd. (a)) . . . [with a few exceptions not applicable in this case] (§ 361.5, *1058 subd. (b)). During the second period, which runs from the six-month review hearing to the 12-month review hearing (§ 366.21, subd. (f)), a heightened showing is required to continue services. So long as reasonable services have in fact been provided, the juvenile court must find `a substantial probability' that the child may be safely returned to the parent within six months in order to continue services. (§ 366.21, subd. (e).) (2) During the final period, which runs from the 12-month review hearing to the 18-month review hearing (§ 366.22), services are available only if the juvenile court finds specifically that the parent has `consistently and regularly contacted and visited with the child,' made `significant progress' on the problems that led to removal, and `demonstrated the capacity and ability both to complete the objectives of his or her treatment plan and to provide for the child's safety, protection, physical and emotional well-being, and special needs.' (§ 366.21, subd. (g)(1)(A)-(C).)" (Tonya M. v. Superior Court (2007) 42 Cal.4th 836, 845 [69 Cal.Rptr.3d 96, 172 P.3d 402], fn. omitted (Tonya M.).)
In this case, the parties disagree on what factors the court should have considered after the first 12 months of reunification services. There are three applicable statutory provisions: (1) section 361.5, former subdivision (a)(2), providing guidelines for extending the preset designated time periods for reunification services; (2) section 366.21, subdivision (f), stating the child must be returned to the parent after 12 months of dependency proceedings unless certain findings are made; and (3) section 366.21, subdivision (g)(1), giving the court three options if the child is not returned, which include the choice of authorizing an additional six months of reunification services. Of these three statutes, two contain language acknowledging incarcerated parents face unique challenges in complying with court-ordered reunification plans and visitation schedules. (§§ 361.5, former subd. (a)(2), 366.21, subd. (f).)
The first statute listed above, section 361.5, former subdivision (a)(2) provides generally that reunification services "may be extended" to 18 months if at the 12-month review hearing the juvenile court "finds that there is a substantial probability that the child will be returned to the physical custody" of his or her parent within the extended time period. (§ 361.5, former subd. (a)(2).) In making this determination, "the court shall consider the special circumstances of an incarcerated . . . parent . . . including, but not limited to, barriers to [his or her] access to services and ability to maintain contact with his or her child. The court shall also consider, among other factors, good faith efforts that the parent or guardian has made to maintain contact with the child." (Ibid.)
(3) Similarly, the statutory provision concerning 12-month review hearings also requires juvenile courts to consider the special circumstances of incarcerated parents. As noted above, after 12 months of dependency, the *1059 court must return the child to the parent unless it finds, by a preponderance of the evidence, that return would "create a substantial risk of detriment to the safety, protection, or physical or emotional well-being of the child." (§ 366.21, subd. (f).)
(4) Detriment can be shown many different ways. However, the code specifically provides "The failure of the parent . . . to participate regularly and make substantive progress in court-ordered treatment programs shall be prima facie evidence that return would be detrimental." (§ 366.21, subd. (f), italics added.) A significant exception to this statutory presumption applies in cases involving incarcerated or institutionalized parents. When considering an incarcerated parent's efforts and progress with a reunification case plan, the court shall consider "the extent to which he or she availed himself or herself of services provided, taking into account the particular barriers to an incarcerated. . . parent['s] . . . access to those court-mandated services and ability to maintain contact with his or her child." (Ibid.) Thus, if the parent was unable to receive services or maintain the same level of contact during a period of incarceration, the court could still order the child returned to the parent absent evidence of a substantial risk of detriment.
Section 366.21, subdivision (g) does not have a similar provision calling for additional deliberations in cases involving incarcerated parents. Significantly, it also does not contain language creating a statutory presumption against those parents as found in section 366.21, subdivision (f). This distinction is logical because subdivision (g) is triggered only after the court has made a finding under subdivision (f), the child cannot be returned after 12 months of dependency to parental custody because there still exists a substantial risk of detriment. (§ 366.21, subd. (g).) Subdivision (g) provides the court with three options: (1) continue the case for six months; (2) schedule a permanency hearing under section 366.26; or (3) order the child remain in long-term foster care. (§ 366.21, subd. (g)(1)-(3).) In considering these options, the Legislature did not encumber the juvenile court with any presumptions for or against the parents.
(5) Rather, before choosing the first option and continuing the case, the juvenile court must review the record and make the additional finding "there is a substantial probability that the child will be returned to the physical custody" of his or her parent within the extended period of time. (§ 366.21, subd. (g)(1).) To make this finding, "the court shall be required to find all of the following: [¶] (A) That the parent . . . has consistently and regularly contacted and visited with the child. [¶] (B) That the parent . . . has made significant progress in resolving problems that led to the child's removal from the home. [¶] (C) The parent . . . has demonstrated the capacity and ability both to complete the objectives of his or her treatment plan and to provide for *1060 the child's safety, protection, physical and emotional well-being, and special needs." (Ibid.) The statute explains if these three factors are present, then there was "a compelling reason for determining [a permanency hearing] is not in the best interests of the child." (Ibid.) It recognizes a parent who still poses a risk of detriment at the 12-month hearing could with additional time successfully rehabilitate and reunify. Nevertheless, the Legislature has set a very high hurdle for continuing the case beyond 12 months.
Father first argues section 366.21, subdivision (g), should never apply when evaluating an incarcerated parent because he or she could never be able to satisfy the requirements in paragraphs (A) through (C). Father provides no case authority or rational basis for such a radical departure from the law. There is no reason to infer from the current statutory scheme the Legislature intended to toll timelines, or automatically extend reunification services to 18 or 24 months for incarcerated parents. To the contrary, the statutory provisions calling for special consideration do not suggest the incarcerated parent should be given a free pass on compliance with the service plan or visits. That there are barriers unique to incarcerated parents is but one of many factors the court must take into consideration when deciding how to proceed in the best interests of the dependent child.
Alternatively, Father suggests the court relied too heavily on section 366.21, subdivision (g)(1), in deciding whether to continue the case and it failed to adequately consider the "substantial probability" analysis (including the special circumstances of incarcerated parents) required under section 361.5, former subdivision (a)(2), for continuing reunification services. Again, we disagree.
(6) Under the dependency legislative scheme, sections 361.5, former subdivision (a)(2) and 366.21, subdivision (g), construed together govern the juvenile court's choices at the 12-month review hearing when it has been determined the child cannot be returned due to substantial risk of detriment. As described above, one section discusses the guidelines to be considered for continuing the case, and the other discusses the rules for continuing services for the same period of time. The two concepts are necessarily linked by the reality a parent who qualifies for additional services will undoubtedly require the case also be continued if reunification is to occur. Conversely, to warrant extension of the time a child must wait for stability and permanency, beyond the six-month or 12-month target dates, there must exist more than just mere hope additional services will facilitate reunification.
(7) County counsel agrees the statutes govern together and argues the court correctly followed the law by reflecting on the guidelines and factors delineated in each one. However, we note county counsel also made a *1061 seemingly contrary argument the additional "incarceration considerations" cannot be implied into section 366.21, subdivision (g), and accordingly, need not be considered by the court at the 12-month hearing. This suggested statutory construction would require the court to essentially consider this one statutory provision in a vacuum. "Dependency provisions `must be construed with reference to [the] whole system of dependency law, so that all parts may be harmonized.' (In re David H. (1995) 33 Cal.App.4th 368, 387 [39 Cal.Rptr.2d 313]; accord, In re Marilyn H. (1993) 5 Cal.4th 295, 307 [19 Cal.Rptr.2d 544, 851 P.2d 826] [`One section of the dependency law may not be considered in a vacuum']; Cynthia D. v. Superior Court (1993) 5 Cal.4th 242, 253 [19 Cal.Rptr.2d 698, 851 P.2d 1307] [individual dependency statute `cannot properly be understood except in the context of the entire dependency process of which it is part'].) By examining the dependency scheme as a whole, we can better understand the consequences of a particular interpretation, avoid absurd or unreasonable results, and select the interpretation most consonant with the Legislature's overarching goals. [Citation.]" (Tonya M., supra, 42 Cal.4th at pp. 844-845.)
The Legislature's goals are clear: "We have long recognized that providing children expeditious resolutions is a core concern of the entire dependency scheme." (Tonya M., supra, 42 Cal.4th at p. 847, fn. 4.) "The reality is that childhood is brief; it does not wait while a parent rehabilitates himself or herself. The nurturing required must be given by someone, at the time the child needs it, not when the parent is ready to give it." (In re Debra M. (1987) 189 Cal.App.3d 1032, 1038 [234 Cal.Rptr. 739].)
Here, the trial court correctly began its analysis by considering if the children could be returned to Father at the 12-month review hearing as mandated by section 366.21, subdivision (f). The court stated it understood it must "view" Father's failure to "complete substance abuse counseling and therapy and testing and all the other things that . . . [he] failed to do . . . through the lens of [the special incarceration circumstances] language there in subdivision (f) . . . ." After considering argument from counsel about whether the case should be continued, the court correctly stated subdivision (f) related to whether the child should be returned home, and not whether additional reunification services should be offered. The court concluded Father had not complied with all the elements of the service plan, but no one was "arguing that either parent is able to take the child at this time, due to their current incarceration, as well as their inability to complete the service plan. So the court does find that it would create a substantial risk of detriment to the physical and emotional well being of the children to be returned to the parents at this time." This was the proper required finding under section 366.21, subdivision (f).
*1062 After concluding return to Father was not feasible, logically the juvenile court's next decision was on how to proceed. To continue the case another six months, and thus provide more reunification services, the juvenile court was required to decide if there was a substantial probability of return within the extended time period. (§ 366.21, subd. (g) [must make finding of substantial probability of return]; § 361.5, former subd. (a)(2) [must make finding of substantial probability of return].) In reaching this ultimate finding, the court must harmonize the requirements listed in both sections 366.21, former subdivision (g) (continuance of case), and 361.5, subdivision (a)(2) (continuance of services).
(8) The provisions construed together call for the court to essentially determine if the parent has demonstrated sufficient rehabilitation to complete the program plan in the extended time, as well as the ability to once more adequately provide for a child's emotional and physical well-being. Neither provision lowers the threshold finding in cases involving incarcerated parents. To the contrary, the extent to which a parent has progressed in resolving the problems that led to the child's removal necessarily depends on the parent's efforts and successes during the entire reunification period. Depending on the length of the incarceration and the severity of the problems that must be addressed, a parent who spent time in custody could still demonstrate the "capacity and ability . . . to complete the objectives of his or her treatment plan" if given additional time. (§ 366.21, subd. (g).) Perfection is certainly not the standard, but a demonstrated lack of progress necessary for reunification, regardless of its cause, is absolutely relevant when the ultimate goal is expeditious resolution for the child.
Here, the juvenile court aptly surmised, "The court, I believe, under [section] 361.5[, subdivision (a)(2),] does need to take into account the circumstances of the parent in making a determination as to whether or not to extend services, and I think that . . . seem[s] appropriate. It provides the court with, I think, sort of a safety valve, when you have parents who are in unfortunate circumstances, to provide them with an opportunity to have a little more time to reunify with their children when they've been prevented from being able to do so because of their incarceration." The court concluded this safety valve was not applicable in Father's case. It acknowledged Father made a good faith effort to utilize the services available to him during his lengthy incarceration, but nevertheless it could not be ignored he was unable to obtain the services relevant to the problems leading to removal of the children. Without evidence the "major drug issues" had been ameliorated, the court could not have possibly made the finding there was a substantial probability of return. In addition, the court noted Father's conduct when he was briefly out of custody suggested "the likelihood of [him] remaining out of custody, even if [he was released in a few months was] fairly small."
*1063 Finally, the court reviewed the three factors listed in section 366.21, subdivision (g), in the context of the special circumstances of an incarcerated parent. With respect to the first factor regarding regular contact (§ 366.21, subd. (g)(1)(A)), the court stated, "I think that the record is pretty good that the parents, in the context of their incarceration, have had contact with the children." The court determined that element had been satisfied.
However, the court concluded the same was not true with respect to the second factor concerning whether a parent had made significant progress in resolving the problems that led to the child's removal. (§ 366.21, subd. (g)(1)(B).) It stated, "Even considering . . . the parents' limited ability to involve themselves in services because of their incarceration, the court still can't find that there's been significant progress . . . ." Similarly, it concluded the third factor (§ 366.21, subd. (g)(1)(C)) had not been established, "Projecting out six months, I guess we're looking to April, taking into account what the parents will be able to achieve in that period of time, based on their past performance and what's available, it just doesn't appear to the court that . . . there's a substantial probability that they'd be able to rehabilitate and be able to have the children placed in their home by the next court date." The court noted Father was due to be released in March, giving him less than 30 days "to fully rehabilitate and be ready to have the children back." Given these facts, the court concluded the case and services could not be continued and the case should be set for a permanency hearing.
(9) We find the court's reasoning logical and amply supported by the record. Father does not suggest his problems with substance abuse, domestic violence, lack of adequate housing, criminal propensities, and parenting deficiencies could be resolved within the 30 days after he was released from jail. When Father was out of custody for approximately 30 days in November 2008, he missed the appointments to drug test and have a drug patch applied. His one drug test was positive. Father did not start parenting education or a substance abuse program. He failed to keep in contact with the social worker and was arrested for shoplifting. Similarly, when Father was out of custody for 17 days in January, he failed to participate in any services, ignored the social worker's attempts at contact, associated with gangs, was kicked out of his mother's house for using drugs, and was arrested for taking a vehicle. The safety valve the Legislature installed for incarcerated parents who were somehow able to make significant progress despite their incarceration was not intended to apply to parents such as Father. The record shows he demonstrated no effort towards rehabilitation when he had the opportunity, and his children should not be asked to wait any longer.


*1064 III
The writ petition is denied.
Rylaarsdam, Acting P. J., and Aronson, J., concurred.
NOTES
[1]  All further statutory references are to the Welfare and Institutions Code, unless otherwise indicated.
[2]  The children's mother (Mother) did not file a writ petition, and therefore, facts relating to her will only be discussed when necessary.
[3]  We recognize the subdivisions of section 361.5 were renumbered as a result of legislation effective January 2010. The reunification services extension provision, formerly codified in subdivision (a)(2), is now codified in subdivision (a)(3), without any other modification.
