Clean up some of the logging code