add optional arguments for parser class instantiation. clean some unused vars.