major code base surgery, should be mostly C style from now.