use same stuff for parsing & building