Migration to Scala