Minor null check refactoring