Public trait to case class