Refactors parsing and update test suite