XR-3710 Extract method for large conditional
XR-3710 Extract method for large conditional

The two IF-s are really better handled by one IF.

zeroturnaround/sql-formatter,zeroturnaround/sql-formatter,zeroturnaround/sql-formatter