Better logging, cleanup