More idiomatic ways of handling nil