More idiomatic implementation