idiomatic refactor