Remove trailing whitespace and cleaned up logging