Slightly more idiomatic Ruby