cleaning up some logging code