Refactoring out comment logging