converted class to case class