More idiomatic kotlin example