more idiomatic code