- Replaced redundant conditional checks with a single guard clause - Added unit test for edge case handling null input