; and (ii) shall terminate any contract described in clause (i) not later than the date that is 3 years after the date of the enactment of this Act. (B) Ownership and operation requirement Beginning on the date that is 3 years after the date of the enactment of this Act, any program or facility used for the activities described in subparagraph (A)(i) shall be owned and operated by a nonprofit organization or by the Department of Homeland Security. (3) Implementation plan Not later than 60 days after the date of the enactment of this Act, the Secretary of Homeland Security shall develop, and make publicly available, a plan and a timeline for the implementation of this subsection. 6. Appearance of detained aliens for other legal matters The Secretary of Homeland Security shall make rules to ensure that any alien who is detained in the custody of the Department of Homeland Security, and who is required to appear in Federal or State court (including family court) for another matter, is transported by an officer or employee of the Department of Homeland Security to such court proceeding. 7. Procedures for detaining aliens (a) Probable cause and custody determination hearings Section 236 of the Immigration and Nationality Act ( 8 U.S.C. 1226 ) is amended— (1) by amending subsection (a) to read as follows: (a) Arrest, detention, and release On a warrant issued by an immigration judge, or pursuant to section 287(a)(2), the Secretary of Homeland Security may arrest an alien, and in accordance with this section, detain the alien or release the alien on bond, subject to conditions, or recognizance, pending a decision on whether the alien is to be removed from the United States. ; (2) by striking subsections (b) and (e); (3) by redesignating subsections (c) and (d) as subsections (b) and (c), respectively; (4) by striking Attorney General each place such term appears and inserting Secretary of Homeland Security