; (II) the physical and mental maturity of the juvenile; (III) the present mental state of the juvenile, including whether the juvenile presents an imminent risk of harm to the juvenile; (IV) the nature and circumstances of the alleged offense; (V) the juvenile's history of prior delinquent acts; (VI) the relative ability of the available adult and juvenile detention facilities to not only meet the specific needs of the juvenile but also to protect the safety of the public as well as other detained youth; and (VII) any other relevant factor; and (iii) if a court determines under subparagraph (A) that it is in the interest of justice to permit a juvenile to be held in any jail or lockup for adults— (I) the court shall hold a hearing not less frequently than once every 30 days, or in the case of a rural jurisdiction, not less frequently than once every 45 days, to review whether it is still in the interest of justice to permit the juvenile to be so held or have such sight or sound contact; and (II) the juvenile shall not be held in any jail or lockup for adults, or permitted to have sight or sound contact with adult inmates, for more than 180 days, unless the court, in writing, determines there is good cause for an extension or the juvenile expressly waives this limitation; . (I) in paragraph (12)(A), by striking contact and inserting sight or sound contact ; (J) in paragraph (13), by striking contact each place it appears and inserting sight or sound contact ; (K) in paragraph (14)— (i) by striking adequate system and inserting effective system ; (ii) by inserting lock-ups, after monitoring jails, ; (iii) by inserting and after detention facilities, ; (iv) by striking , and non-secure facilities ; (v) by striking insure and inserting ensure ; (vi) by striking requirements of paragraphs (11), (12), and (13) and inserting core requirements ; and (vii) by striking , in the opinion of the Administrator, ; (L) by striking paragraphs (22) and (27); (M) by redesignating paragraph (28) as paragraph (27)