tidy up logging