Avoid duplication on param filter

Just a little tested refactor to avoid duplication.