Combine if statements to reduce complexity
Extracted function to parse row