[E] Add parser tests, small refactor