refine if and try to soak up null references