fix logging, clean up