Refactoring where == is replaced by is for None