helpers for serializing the state of a filter