clean up and AMR