LPS-41618 simplify the logic to remove the redundancy and make sure the lowercase condition applies however the query is originally formed (like == true ? lowercase : don't)