small refactoring

removed unnecessary non-nil check