cleanup and the start of some logging