New JS and Scala code