Refactor to PEG grammar