I would start from extracting null checks to named...
# codereview
k