Reduced bilerplate in Scala version