case class to case object