Convert filtering into an interface