mwf: begin parser refactoring