; (B) by striking the matter preceding paragraph (1), and inserting Except in a removal case covered by section 3142(i), if a person is ordered released by a magistrate judge— ; (C) in paragraph (1)— (i) by striking court having original jurisdiction over the offense and inserting district court ; (ii) by inserting after conditions of release the following: at any time before trial ; and (iii) by striking and ; and (D) by striking paragraph (2) and inserting the following: (2) the person may file, with the magistrate judge or with the district court, a motion for amendment of the conditions of release at any time before trial; and (3) motions under this subsection shall be determined promptly. ; (2) by striking subsection (b) and inserting the following: (b) Review of a detention order (1) Review by a magistrate judge Except in a removal case covered by section 3142(i), if a person is ordered detained by a magistrate judge, the person may file with the magistrate judge a motion for reconsideration or amendment of the order for any reason material to the inquiry in section 3142, at any time before trial. The person is entitled to a hearing on that motion. The pretrial release hearing standards in subsection (f) of section 3142 govern at that reopened hearing. (2) Review by a district court Except in a removal case covered by section 3142(i), if a person is ordered detained by a magistrate judge, the person may file, with the district court, a motion for pretrial release. The motion shall be heard within 72 hours unless the person consents to a delay. The district court shall review the motion and release or detain the person after a hearing under section 3142.