WIP: parser refactoring