Some cleanup + logging