Simplified code in .isEmpty