Mexican President Andrés Manuel López Obrador is pursuing his plan to replace the country’s federal judiciary with elected judges and magistrates before he steps down on Sept. 1—a move that has the legal sector and investors on edge.

The country’s system of appointed judges, while imperfect, has clear steps for professional advancement that lawyers say promote some degree of impartiality. But the president has accused the judiciary of being corrupt and wants to fire more than a thousand judges. Stories abound in Mexico of judges being paid off to rule one way or another.