updated parser to cope with polymorphic fields