Error parsing refactor