To detain defendants who are considered a high risk to the public or themselves, prosecutors have to file formal motions with a Superior Court judge, who conducts a hearing, as Critchley did on Major on Thursday.