making Scala class definitions more idiomatic