More idiomatic Kotlin example