mechanically simplified parser to use a single type with a few constructors