Remove unnecessary check for case class