extended logging and minor cleanings