Move comment removal into another function