Add some logging
Reorganise
Add more logging