tidy up of logging