Don't mutate the input parameters

We shouldn't mutate the inbound filter params, so instead take a copy that we can mutate.