LPS-47852 Refactor: extract repeated code
LPS-47852 Refactor: flip 'if' condition
LPS-47852 SF