added more idiomatic ruby