Mangler cosmetic cleanup

Reading the code, I tried to make some sense of it and cleaned it up a bit.