Refactor of the IsNullOrEmpty

Simplified the implementation of the IsNullOrEmpty method.