tidied up some logging