simplify nil checks