Scala wrapper improved