updating with idiomatic Scala