parser refactoring and additional parser tests