is it possible that `val` is ever not a string? For example, could it be `None` or some other value like an number? Does that matter?