added better case class support