extracted a method to parse the comment contents