refactored comment parsing