Abstract filter code into a FilterManager class