Improve case class filter