More Scala conversion