LPS-50083 Refactored to avoid one new if with same condition