I think it might be easier to understand if you handle the "in is null" case first in the code.