major rework of parser