Made more idiomatic