A little refactoring of comment handling with some tests