debugging stats logging
major cleanup