Flatten if statements
Ignore case in regex options instead
Convert to lambda