restructure of parser