[RJA-1598] [feature] - Pattern matching changed to if