change case class to object