Refactoring where clause.