Clean up
Add some logging