supposedly more idiomatic code