Cleanup, improve logging