Refactored to generic base parser