abstract out the actual filtering into a separate class