fix null check of input before using it
remove duplicate active pattern with Contains
Replace PrefixUntil by the equivalent pattern : Contains