Extended the parser to handle weird nesting of fields and categories