Use idiomatic Scala functional style.