Cleaning up some logging code