Put back in old code for m3s 

But left in the slight refactoring for easier testing. AWS & M3s are in flux at the moment.