Removing duplicate null checks