Scala api: reduced copy paste a bit