More idiomatic refactoring