use more idiomatic code style