Refactor DocumentFilters to be built with a factory.