Cake Pattern in Scala