Refactored the empty string check code to be less complication (using isEqualToString method).