filter before serializing and before matching