Logging and comment cleanup