Removed redundant null check
Simplified code