Reorganize parser code.