misc cleanup and logging