code cleanups for m1 and m2