refactoring parser