Moved the document filter to a separate class