Add classes before filtering