Moving methods to Scala