Replaced equals with isEmpty for readability