starts refactoring parser and updates tests