Move the ADL setup and clearing to separate functions and provide a reinit_adl function to be used when adl fails while running.