make the parser generic