Relocated a bunch of aux. code.