unify AAG and AIG parsers a little bit