Refactoring parser class